diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-02 23:09:40 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-05-02 23:23:35 -0300 |
commit | 5d26c8f00a11e40660be7516a13512ed522863ed (patch) | |
tree | b8954479f19d5a9ad3fdb44d4f0d0f7ce11a5d54 /activerecord/test/cases | |
parent | 36720af42995c8bac06ea7187e2c5768f89c2783 (diff) | |
download | rails-5d26c8f00a11e40660be7516a13512ed522863ed.tar.gz rails-5d26c8f00a11e40660be7516a13512ed522863ed.tar.bz2 rails-5d26c8f00a11e40660be7516a13512ed522863ed.zip |
Fix issue with private kernel methods and collection associations. Closes #2508
Change CollectionProxy#method_missing to use scoped.public_send, to
avoid a problem described in issue #2508 when trying to use class
methods with names like "open", that clash with private kernel methods.
Also changed the dynamic matcher instantiator to send straight to
scoped, to avoid another roundtrip to method_missing.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index a98e5b115c..f74fe42dc2 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1703,4 +1703,9 @@ class HasManyAssociationsTest < ActiveRecord::TestCase ensure ActiveRecord::Base.dependent_restrict_raises = option_before end + + def test_collection_association_with_private_kernel_method + firm = companies(:first_firm) + assert_equal [accounts(:signals37)], firm.accounts.open + end end |