This project is archived and is in readonly mode.

#852 ✓resolved
Tom Lea

Named Scope respond_to? error coercing to array.

Reported by Tom Lea | August 18th, 2008 @ 05:53 PM | in 2.x

test_has_many_associations_have_access_to_named_scopes and test_has_many_through_associations_have_access_to_named_scopes from named_scope_test.rb were erroring as Array#& tried to coerce a Scope to an Array.

Was getting similar to the following:


test_has_many_through_associations_have_access_to_named_scopes(NamedScopeTest):
ArgumentError: wrong number of arguments (2 for 1)
    ./test/cases/../../lib/active_record/associations/association_proxy.rb:176:in `respond_to?'
    ./test/cases/../../lib/active_record/associations/association_proxy.rb:176:in `&'
    ./test/cases/../../lib/active_record/associations/association_proxy.rb:176:in `send'
    ./test/cases/../../lib/active_record/associations/association_proxy.rb:176:in `method_missing'
    ./test/cases/../../lib/active_record/associations/association_collection.rb:285:in `method_missing'
    ./test/cases/named_scope_test.rb:143:in `test_has_many_through_associations_have_access_to_named_scopes'
    ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `__send__'
    ./test/cases/../../lib/../../activesupport/lib/active_support/testing/setup_and_teardown.rb:94:in `run'

Self explanatory patch attached to fix this.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages