I want to be able to have a virtual attribute on a non-database model that is a hash. I just can’t figure out what the syntax is for adding and removing items from this hash:
If I define:
attr_accessor :foo, :bar
then in a method in the model, I can use:
self.foo = "x"
But I can’t say:
self.bar["item"] = "value"
Try