This project is archived and is in readonly mode.

#818 ✓resolved
Eloy Duran

Fixed #respond_to? on ActiveRecord::NamedScope::Scope.

Reported by Eloy Duran | August 13th, 2008 @ 12:57 PM | in 2.x

The Scope class delegates most of the standard methods to the @proxy_found array. It also does this for #respond_to? which breaks stuff, for instance working with test/spec which properly checks if a method exists before dispatching.

This patch makes #respond_to? on instances of Scope work again, but it will also check if the @proxy_scope responds to the message, thus going up the chain to ActiveRecord::Base.

It also changes [].methods to Array.instance_methods, because that's just a bit cleaner.

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