A 2.3.2 test case that spews:
/home/adam/ror/2.3.2/vendor/rails/activerecord/lib/active_record/base.rb:2189:in
dup': can't dup NilClass (TypeError) from /home/adam/ror/2.3.2/vendor/rails/activerecord/lib/active_record/base.rb:2189:in
scoped_methods’
from
/home/adam/ror/2.3.2/vendor/rails/activerecord/lib/active_record/base.rb:2193:in
current_scoped_methods' from /home/adam/ror/2.3.2/vendor/rails/activerecord/lib/active_record/base.rb:2183:in
scope’
from
/home/adam/ror/2.3.2/vendor/rails/activerecord/lib/active_record/base.rb:2414:in
set_readonly_option!' from /home/adam/ror/2.3.2/vendor/rails/activerecord/lib/active_record/base.rb:610:in
find’
from /home/adam/ror/2.3.2/lib/test1.rb:9:in `initialize_test’
Here is the relevant code to duplicate. The interesting thing is, just
the existance of the empty self.inherited© declaration triggers the
spew. Remove the declaration and no spew. Also, this works fine in 2.2.2
(no spew).
Create a fresh 2.3.2, and script/console this:
class Y < ActiveRecord::Base
def self.inherited©
end
end
class T < Y
end
T.find(:all) # Unexpected spew
On Jun 18, 11:10 am, “Adam Ms.” [email protected]
wrote:
Here is the relevant code to duplicate. The interesting thing is, just
the existance of the empty self.inherited(c) declaration triggers the
spew. Remove the declaration and no spew. Also, this works fine in 2.2.2
(no spew).
Create a fresh 2.3.2, and script/console this:
class Y < ActiveRecord::Base
def self.inherited(c)
end
end
class T < Y
end
T.find(:all) # Unexpected spew
You are overwriting the inherited method from ActiveRecord::Base with
your own but without calling the existing implementation
Fred
Frederick C. wrote:
On Jun 18, 11:10�am, “Adam Ms.” [email protected]
wrote:
Here is the relevant code to duplicate. The interesting thing is, just
the existance of the empty self.inherited(c) declaration triggers the
spew. Remove the declaration and no spew. Also, this works fine in 2.2.2
(no spew).
Create a fresh 2.3.2, and script/console this:
class Y < ActiveRecord::Base
� def self.inherited(c)
� end
end
class T < Y
end
T.find(:all) �# Unexpected spew
You are overwriting the inherited method from ActiveRecord::Base with
your own but without calling the existing implementation
Fred
DOH!
Thanks Fred.
I’m going back to my job at McDonalds now.