Skip to content

Commit d97980a

Browse files
committed
Remove delegation of missing methods in a relation to arel
1 parent a7becf1 commit d97980a

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

activerecord/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove delegation of missing methods in a relation to arel.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove delegation of missing methods in a relation to private methods of the class.
26

37
*Rafael Mendonça França*

activerecord/lib/active_record/relation/delegation.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ def method_missing(method, *args, &block)
112112
if @klass.respond_to?(method)
113113
self.class.delegate_to_scoped_klass(method)
114114
scoping { @klass.public_send(method, *args, &block) }
115-
elsif arel.respond_to?(method)
116-
ActiveSupport::Deprecation.warn \
117-
"Delegating #{method} to arel is deprecated and will be removed in Rails 6.0."
118-
arel.public_send(method, *args, &block)
119115
else
120116
super
121117
end

activerecord/test/cases/relation/delegation_test.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,8 @@ module ArrayDelegationTests
2323
end
2424
end
2525

26-
module DeprecatedArelDelegationTests
27-
AREL_METHODS = [
28-
:with, :orders, :froms, :project, :projections, :taken, :constraints, :exists, :locked, :where_sql,
29-
:ast, :source, :join_sources, :to_dot, :create_insert, :create_true, :create_false
30-
]
31-
32-
def test_deprecate_arel_delegation
33-
AREL_METHODS.each do |method|
34-
assert_deprecated { target.public_send(method) }
35-
assert_deprecated { target.public_send(method) }
36-
end
37-
end
38-
end
39-
4026
class DelegationAssociationTest < ActiveRecord::TestCase
4127
include ArrayDelegationTests
42-
include DeprecatedArelDelegationTests
4328

4429
def target
4530
Post.new.comments
@@ -48,7 +33,6 @@ def target
4833

4934
class DelegationRelationTest < ActiveRecord::TestCase
5035
include ArrayDelegationTests
51-
include DeprecatedArelDelegationTests
5236

5337
def target
5438
Comment.all

0 commit comments

Comments
 (0)