diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-03-30 09:28:12 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-03-30 09:55:21 +0900 |
commit | 0bfeb481a0aa35eeca1c5230938fa61fee0faef2 (patch) | |
tree | 705aebd8bd1f5f1344ee556ed26f1dadc2073980 /activerecord/test/cases/scoping | |
parent | b9be64cc3e2959c974c3036a0eb5a37fc8c7d580 (diff) | |
download | rails-0bfeb481a0aa35eeca1c5230938fa61fee0faef2.tar.gz rails-0bfeb481a0aa35eeca1c5230938fa61fee0faef2.tar.bz2 rails-0bfeb481a0aa35eeca1c5230938fa61fee0faef2.zip |
Deprecate accessibility of private/protected class methods in named scope
Diffstat (limited to 'activerecord/test/cases/scoping')
-rw-r--r-- | activerecord/test/cases/scoping/named_scoping_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb index ea71a5ce28..03f8a4f7c9 100644 --- a/activerecord/test/cases/scoping/named_scoping_test.rb +++ b/activerecord/test/cases/scoping/named_scoping_test.rb @@ -303,6 +303,13 @@ class NamedScopingTest < ActiveRecord::TestCase assert_equal "lifo", topic.author_name end + def test_deprecated_delegating_private_method + assert_deprecated do + scope = Topic.all.by_private_lifo + assert_not scope.instance_variable_get(:@delegate_to_klass) + end + end + def test_reserved_scope_names klass = Class.new(ActiveRecord::Base) do self.table_name = "topics" |