On Mon, 2005-05-23 at 13:46, Jamis Buck wrote:
> >
> >>> Adding:
> >>>
> >>> class Array
> >>>     def self.===(other)
> >>>         other.is_a? self
> >>>         end
> >>>     end
> >>>
> >>> right above the code in question fixes it.
> >>>

> It's proxying to an array, and undefining all the relevant methods on  
> the proxy so that things like #class get passed to the proxy, too.  
> Unfortunately, it looks like === doesn't get proxied, and I'm not  
> sure why. Perhaps Ruby does some optimizing under the covers?

So my conclusion:

This is a bug in the code that does the proxying, and either the
following snippet should be added to the proxy class:

class AssociationProxy
     def self.===(other)
        other.is_a? Array
        end
    end

or "class" should be removed from set of the proxied methods.

Otherwise, it breaks the semantics of a number of Ruby idioms for no
good reason--in other words, it's a bug, not a feature.

Any idea who owns this or who I should propagate it to?  Jamis?

--MarkusQ

P.S. A little voice in the back of my head is muttering something about
Object#Hash and Object#object_id as well...