aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2019-01-14 22:04:22 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2019-01-17 16:08:32 -0500
commitd97980a16d76ad190042b4d8578109714e9c53d0 (patch)
tree0972249bfabceade1ff49729a9b6f6f1945de867
parenta7becf147afc85c354e5cfa519911a948d25fc4d (diff)
downloadrails-d97980a16d76ad190042b4d8578109714e9c53d0.tar.gz
rails-d97980a16d76ad190042b4d8578109714e9c53d0.tar.bz2
rails-d97980a16d76ad190042b4d8578109714e9c53d0.zip
Remove delegation of missing methods in a relation to arel
-rw-r--r--activerecord/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/relation/delegation.rb4
-rw-r--r--activerecord/test/cases/relation/delegation_test.rb16
3 files changed, 4 insertions, 20 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index d6279cd541..13c08d0b55 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Remove delegation of missing methods in a relation to arel.
+
+ *Rafael Mendonça França*
+
* Remove delegation of missing methods in a relation to private methods of the class.
*Rafael Mendonça França*
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb
index 2055b1637a..6e8a1fcad4 100644
--- a/activerecord/lib/active_record/relation/delegation.rb
+++ b/activerecord/lib/active_record/relation/delegation.rb
@@ -112,10 +112,6 @@ module ActiveRecord
if @klass.respond_to?(method)
self.class.delegate_to_scoped_klass(method)
scoping { @klass.public_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."
- arel.public_send(method, *args, &block)
else
super
end
diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb
index a8030c2d64..b600c999a6 100644
--- a/activerecord/test/cases/relation/delegation_test.rb
+++ b/activerecord/test/cases/relation/delegation_test.rb
@@ -23,23 +23,8 @@ module ActiveRecord
end
end
- module DeprecatedArelDelegationTests
- AREL_METHODS = [
- :with, :orders, :froms, :project, :projections, :taken, :constraints, :exists, :locked, :where_sql,
- :ast, :source, :join_sources, :to_dot, :create_insert, :create_true, :create_false
- ]
-
- def test_deprecate_arel_delegation
- AREL_METHODS.each do |method|
- assert_deprecated { target.public_send(method) }
- assert_deprecated { target.public_send(method) }
- end
- end
- end
-
class DelegationAssociationTest < ActiveRecord::TestCase
include ArrayDelegationTests
- include DeprecatedArelDelegationTests
def target
Post.new.comments
@@ -48,7 +33,6 @@ module ActiveRecord
class DelegationRelationTest < ActiveRecord::TestCase
include ArrayDelegationTests
- include DeprecatedArelDelegationTests
def target
Comment.all