Hey everyone.
My mind has been boggled by an issue I ran into a few hours ago. I am completely lost as to why the following code behaves the way it does and would appreciate any hints from you guys. It would already be super-helpful if others could post their output for the following so that I can figure out whether this is weirdness specific to my setup or a global phenomenon.
So far, ActiveRecord::Base and its descendants are the only classes with which I see this behaviour and furthermore it seems to be limited to Ruby 1.9.1.
Mayday!
Thanks, Niels (about to dig into array.c)
$ ruby --version; rails --version; ruby <<EOR require "rubygems" gem "activerecord" require "activerecord"
puts "\nActiveRecord::Base disappears:" [1,String,'foo',ActiveRecord::Base].collect {|a,b| puts [a,b].inspect}
puts "\nActiveRecord::Base stays:" [1,String,'foo',ActiveRecord::Base].collect {|a| puts [a].inspect}
puts "\nwtf?"
EOR ruby 1.9.1p129 (2009-05-12 revision 23412) [x86_64-linux] Rails 2.3.2
ActiveRecord::Base disappears: [1, nil] [String, nil] ["foo", nil] [nil, nil]
ActiveRecord::Base stays: [1] [String] ["foo"] [ActiveRecord::Base]
wtf?