Here is my class: class Document < ActiveRecord::Base public def initialize puts "Called initialize..." super.initialize end This generates the following error: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occured while evaluating nil.initialize WTF? Wes
on 2006-05-10 20:52
on 2006-05-10 20:58
I think you just need to call super, not super.initialize
on 2006-05-10 21:17
>From the "programming ruby" book... Within the body of a method, a call to super acts just like a call to that original method, except that the search for a method starts in the superclass of the object that was found to have the original method. Explains why you are getting the nil.initialize error. 'super' is like calling initialize, which returns nil.