Skip to content
Tags

,

initialize in active record

September 15, 2011

I recently tried using initialize in active record and hit into a ‘you got nil where you did not expect it’ problem. think this blog entry is relevant and useful. In short, this is because when you define initialize you are actually overriding already defined initialize in active record base model. Try using after_intitialize

http://blog.dalethatcher.com/2008/03/rails-dont-override-initialize-on.html

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: