From: Markus Date: 2005-05-24T05:30:11+09:00 Subject: Re: Array.=== Bug, Rails Bug, or brain failure? On Mon, 2005-05-23 at 13:21, Jamis Buck wrote: > Markus, > > when x.has_many :y, the :y property is not an array. It's an object > that walks and talks like an array. (Just try using x.y.find > sometime--it doesn't work like the Array version, which bit me hard > several times in the past.) I'd buy that except: 1) x.y.class.name == 'Array' 2) x.y.class == Array 3) x.y.class.ancestors == [].class.ancestors 4) as I mentioned, > > Adding: > > > > class Array > > def self.===(other) > > other.is_a? self > > end > > end > > > > right above the code in question fixes it. That's a little strong for duck typing, isn't it? I my book that's somewhere past duct taping and well into bailing wire territory. I admit is possible, but it seems unlikely... --MarkusQ