diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-06 04:37:54 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-06 04:58:45 +0900 |
commit | 0f3e8e1ebb1255bfda455753b1b2087315f46fdc (patch) | |
tree | aef0f617f17d55c8ab98675fcb8440cdb6a0e01c /activerecord/test/cases/relation | |
parent | 7caea98e189c02721b2e944a074c405b033852eb (diff) | |
download | rails-0f3e8e1ebb1255bfda455753b1b2087315f46fdc.tar.gz rails-0f3e8e1ebb1255bfda455753b1b2087315f46fdc.tar.bz2 rails-0f3e8e1ebb1255bfda455753b1b2087315f46fdc.zip |
Relation no longer respond to Arel methods
This follows up d97980a16d76ad190042b4d8578109714e9c53d0.
Diffstat (limited to 'activerecord/test/cases/relation')
-rw-r--r-- | activerecord/test/cases/relation/delegation_test.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb index b600c999a6..63ae438de3 100644 --- a/activerecord/test/cases/relation/delegation_test.rb +++ b/activerecord/test/cases/relation/delegation_test.rb @@ -5,7 +5,7 @@ require "models/post" require "models/comment" module ActiveRecord - module ArrayDelegationTests + module DelegationTests ARRAY_DELEGATES = [ :+, :-, :|, :&, :[], :shuffle, :all?, :collect, :compact, :detect, :each, :each_cons, :each_with_index, @@ -21,10 +21,14 @@ module ActiveRecord assert_respond_to target, method end end + + def test_not_respond_to_arel_method + assert_not_respond_to target, :exists + end end class DelegationAssociationTest < ActiveRecord::TestCase - include ArrayDelegationTests + include DelegationTests def target Post.new.comments @@ -32,7 +36,7 @@ module ActiveRecord end class DelegationRelationTest < ActiveRecord::TestCase - include ArrayDelegationTests + include DelegationTests def target Comment.all |