Skip to content
Permalink
Browse files
Remove delegation of missing methods in a relation to private methods…
… of the class
  • Loading branch information
rafaelfranca committed Jan 17, 2019
1 parent f59b081 commit a7becf147afc85c354e5cfa519911a948d25fc4d
@@ -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 @@ def method_missing(method, *args, &block)
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 @@ def test_should_build_on_top_of_chained_scopes
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"

0 comments on commit a7becf1

Please sign in to comment.