On Mon, 2005-05-23 at 13:30, Markus wrote:
> On Mon, 2005-05-23 at 13:21, Jamis Buck wrote:

> > 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

Ah ha!  We're both right!  It is a bug, and it does involve some of the
most magicalistic duck typing I've yet seen.  Rails (or action*, or...)
changes the Array class!  Observe:

Under regular irb:

(markus@lapdog) > irb
irb(main):001:0> [].class.ancestors
=> [Array, Enumerable, Object, Kernel]

But under script/console:

(markus@lapdog) > script/console
Loading development environment.
irb(main):001:0> [].class.ancestors
=> [Array, Enumerable, Object, Base64::Deprecated, Base64, Kernel]

So now the question is, how did the inserted Base64 goo break '===' for
Array?

--MarkusQ