adric: books icon (c) 2004 adric.net (Default)
adric ([personal profile] adric) wrote2008-11-20 01:54 pm
Entry tags:

Durrr .. what?? (fixed)

>> @item.orders_products_id
=> 5
>> @mop.orders_products_id = @item.orders_products_id
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.delete[etc]

Is this like when the optometrist got a funny look on his face and later admitted my answer had broken a law of physics?

>> @mop.type
(irb):4: warning: Object#type is deprecated; use Object#class
=> MoocashOrderProcessing(orders_products_id: integer, orders_id: integer, processed: integer)
>> @mop.processed = 3
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.delete[usw.]
And the
>> @mop              
NoMethodError: You have a nil object when you didn't expect it!

The constructor was erroring out before the object is created because of my debug line which printed the type of the passed object (which there isn't one in this session). But the real answer was this:
super(nil)


Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org