From: Markus Date: 2005-05-24T21:18:00+09:00 Subject: Re: Array.=== in Rails Bug On Mon, 2005-05-23 at 21:08, Kent Sibilev wrote: > The target of AssociationProxy is not always an instance of Array. For > example, for BelongsToAssociation it's a ActiveRecord::Base instance. > > Kent. Good point. Descending it from Array shouldn't hurt for the other cases, but it won't fix the problem for them either. I suppose we could add === for all classes that might be proxied, by that seems needlessly inefficient (it would pretty much bypass the C version of Class#===). Is it always either an instance of Array or of ActiveRecord? If so, basing AssociationProxy off Array and adding === to ActiveRecord should fix it for both cases. ==MarkusQ > On 5/23/05, Markus wrote: > > On Mon, 2005-05-23 at 15:34, Jamis Buck wrote: > > > You can add a ticket to dev.rubyonrails.com. That way it won't get > > > lost in a shuffle of email. > > > > Did that, but in the meantime I found a better solution (and included it > > in the ticket): > > > > Change AssociationProxy to "class AssociationProxy < Array" and > > let the C code do its thing. No muss, no fuss... > > > > --MarkusQ > > > > > >