I have an ActiveRecord model that uses the ActiveRecordstore feature to turn a textfield into a Hash, to give the record pseudo-noSQL like behavior (ignore for the fact that I'm not using the accessors option):

If you're not familiar with the Hashie gem, it allows you to give useful features to a Hash...in this case, treating a hash key-store as if it were an object with dot-accessible attributes: https://github.com/intridea/hashie

The Mash object in particular automatically bestows these conveniences even upon nested hashes, which is why I want my infodump store to be treated as a Hashie::Mash object.

So how do I initialize that attribute to be a Hashie::Mash? I started off by doing a before_initialize callback to do something like this:

def make_mash
infodump = Hashie::Mash.new(infodump)
end

But then that runs every time the object is instantiated...I only need this object conversion done once in the lifetime of the object.