From 4f2a635661077fd5c3097e2a4c1496760600132a Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 14 Feb 2019 04:34:00 +0900 Subject: Revert "Chaining named scope is no longer leaking to class level querying methods" This reverts #32380, since this may cause that silently leaking information when people upgrade the app. We need deprecation first before making this. --- activerecord/test/cases/scoping/named_scoping_test.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'activerecord/test/cases/scoping') diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb index 27f9df295f..1a3a95f168 100644 --- a/activerecord/test/cases/scoping/named_scoping_test.rb +++ b/activerecord/test/cases/scoping/named_scoping_test.rb @@ -447,9 +447,8 @@ class NamedScopingTest < ActiveRecord::TestCase assert_equal [posts(:sti_comments)], Post.with_special_comments.with_post(4).to_a.uniq end - def test_chaining_doesnt_leak_conditions_to_another_scopes - expected = Topic.where(approved: false).where(id: Topic.children.select(:parent_id)) - assert_equal expected.to_a, Topic.rejected.has_children.to_a + def test_class_method_in_scope + assert_equal [topics(:second)], topics(:first).approved_replies.ordered end def test_nested_scoping -- cgit v1.2.3