diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2017-01-30 14:48:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 14:48:13 -0800 |
commit | ef7b9b867b3c113bbbc7639b5d760a8f962a683c (patch) | |
tree | b056822eaf20721ae2c6b8fd4906547e0df4e9b8 /activerecord/test/cases | |
parent | 1fc995577f44e748bbcaf25c35fd24bb56afc63e (diff) | |
parent | 233630a175f6e6f1ab8c99af380f550038e04b3d (diff) | |
download | rails-ef7b9b867b3c113bbbc7639b5d760a8f962a683c.tar.gz rails-ef7b9b867b3c113bbbc7639b5d760a8f962a683c.tar.bz2 rails-ef7b9b867b3c113bbbc7639b5d760a8f962a683c.zip |
Merge pull request #27851 from tenderlove/scope-chain
Deprecate `scope_chain`
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/reflection_test.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb index 2444eccab1..04ee67c177 100644 --- a/activerecord/test/cases/reflection_test.rb +++ b/activerecord/test/cases/reflection_test.rb @@ -258,7 +258,9 @@ class ReflectionTest < ActiveRecord::TestCase [Post.reflect_on_association(:first_taggings).scope], [Author.reflect_on_association(:misc_posts).scope] ] - actual = Author.reflect_on_association(:misc_post_first_blue_tags).scope_chain + actual = assert_deprecated do + Author.reflect_on_association(:misc_post_first_blue_tags).scope_chain + end assert_equal expected, actual expected = [ @@ -270,7 +272,9 @@ class ReflectionTest < ActiveRecord::TestCase [], [] ] - actual = Author.reflect_on_association(:misc_post_first_blue_tags_2).scope_chain + actual = assert_deprecated do + Author.reflect_on_association(:misc_post_first_blue_tags_2).scope_chain + end assert_equal expected, actual end @@ -395,9 +399,15 @@ class ReflectionTest < ActiveRecord::TestCase end def test_through_reflection_scope_chain_does_not_modify_other_reflections - orig_conds = Post.reflect_on_association(:first_blue_tags_2).scope_chain.inspect - Author.reflect_on_association(:misc_post_first_blue_tags_2).scope_chain - assert_equal orig_conds, Post.reflect_on_association(:first_blue_tags_2).scope_chain.inspect + orig_conds = assert_deprecated do + Post.reflect_on_association(:first_blue_tags_2).scope_chain + end.inspect + assert_deprecated do + Author.reflect_on_association(:misc_post_first_blue_tags_2).scope_chain + end + assert_equal orig_conds, assert_deprecated { + Post.reflect_on_association(:first_blue_tags_2).scope_chain + }.inspect end def test_symbol_for_class_name |