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'' <snip> 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 -- Posted via http://www.ruby-forum.com/.
On Jun 18, 11:10 am, "Adam Ms." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 spewYou are overwriting the inherited method from ActiveRecord::Base with your own but without calling the existing implementation Fred> -- > Posted viahttp://www.ruby-forum.com/.
Frederick Cheung wrote:> On Jun 18, 11:10�am, "Adam Ms." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > 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 > > FredDOH! Thanks Fred. I''m going back to my job at McDonalds now. -- Posted via http://www.ruby-forum.com/.