 <p>Most uses of <code>after_initialize</code> can be (and SHOULD be) replaced with defaults on the corresponding database columns. If you're setting the property to a constant value, you may want to look into this as an alternative.</p> <p>EDIT: if the value isn't constant, a call to <code>has_attribute?(:name)</code> will guard against this error - <a href="http://stackoverflow.com/questions/6820156/activemodelmissingattributeerror-occurs-after-deploying-and-then-goes-away-aft">ActiveModel::MissingAttributeError occurs after deploying and then goes away after a while</a></p>