diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-11-23 13:47:42 -0700 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-11-23 13:47:42 -0700 |
commit | 9d79334a1dee67e31222c790e231772deafcaeb8 (patch) | |
tree | 5e3d1c7fa0f194460fabd80089d922df59cee9fe /activerecord/test/cases | |
parent | 762982f2325ce04a50f2f56b698b9fb7e606a518 (diff) | |
download | rails-9d79334a1dee67e31222c790e231772deafcaeb8.tar.gz rails-9d79334a1dee67e31222c790e231772deafcaeb8.tar.bz2 rails-9d79334a1dee67e31222c790e231772deafcaeb8.zip |
Remove blanket array delegation from `Relation`
As was pointed out by #17128, our blacklist of mutation methods was
non-exhaustive (and would need to be kept up to date with each new
version of Ruby). Now that `Relation` includes `Enumerable`, the number
of methods that we actually need to delegate are pretty small. As such,
we can change to explicitly delegating the few non-mutation related
methods that `Array` has which aren't on `Enumerable`
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/relation/delegation_test.rb | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/activerecord/test/cases/relation/delegation_test.rb b/activerecord/test/cases/relation/delegation_test.rb index 989f4e1e5d..b4269bd56d 100644 --- a/activerecord/test/cases/relation/delegation_test.rb +++ b/activerecord/test/cases/relation/delegation_test.rb @@ -40,12 +40,6 @@ module ActiveRecord assert_respond_to target, method end end - - ActiveRecord::Delegation::BLACKLISTED_ARRAY_METHODS.each do |method| - define_method "test_#{method}_is_not_delegated_to_Array" do - assert_raises(NoMethodError) { call_method(target, method) } - end - end end class DelegationAssociationTest < DelegationTest |