# Unexpected 2.3.2 spew

**URL:** <https://www.ruby-forum.com/t/unexpected-2-3-2-spew/170511>\
**Category:** Rails\
**Created:** [June 18, 2009, 12:10pm UTC](https://www.ruby-forum.com/t/unexpected-2-3-2-spew/170511 "2009-06-18T12:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [June 18, 2009, 12:10pm UTC](https://www.ruby-forum.com/t/unexpected-2-3-2-spew/170511/1 "2009-06-18T12:10:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [June 18, 2009, 1:04pm UTC](https://www.ruby-forum.com/t/unexpected-2-3-2-spew/170511/2 "2009-06-18T13:04:33Z")

</div>

On Jun 18, 11:10 am, “Adam Ms.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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

---

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [June 18, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/unexpected-2-3-2-spew/170511/3 "2009-06-18T17:23:43Z")

</div>

Frederick C. wrote:

> On Jun 18, 11:10ï¿½am, “Adam Ms.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> 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.
