mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove delegation of missing methods in a relation to private methods of the class
This commit is contained in:
parent
f59b08119b
commit
a7becf147a
3 changed files with 4 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
|||
* Remove delegation of missing methods in a relation to private methods of the class.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Deprecate `config.activerecord.sqlite3.represent_boolean_as_integer`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
|
|
@ -112,11 +112,6 @@ module ActiveRecord
|
|||
if @klass.respond_to?(method)
|
||||
self.class.delegate_to_scoped_klass(method)
|
||||
scoping { @klass.public_send(method, *args, &block) }
|
||||
elsif @delegate_to_klass && @klass.respond_to?(method, true)
|
||||
ActiveSupport::Deprecation.warn \
|
||||
"Delegating missing #{method} method to #{@klass}. " \
|
||||
"Accessibility of private/protected class methods in :scope is deprecated and will be removed in Rails 6.0."
|
||||
@klass.send(method, *args, &block)
|
||||
elsif arel.respond_to?(method)
|
||||
ActiveSupport::Deprecation.warn \
|
||||
"Delegating #{method} to arel is deprecated and will be removed in Rails 6.0."
|
||||
|
|
|
@ -303,13 +303,6 @@ 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"
|
||||
|
|
Loading…
Reference in a new issue