Rails 3 updates serialized attribute on change

Using Rails 3 I have several models containing serialized attributes. To perform serialization, I currently use 3 different methods - the serialization method ; activerecord store ; and save custom pearls .

In all cases, when I save a model instance, the serialized attribute is updated, even if the content does not change. This was an amazing discovery, especially when using a custom gem, as the readme state is:

"StoreConfigurable is smart enough to let your parent know when it will change. It is also not stupid. It will only initiate changes if the values ​​you set are different, new or change the state of the configs."

Am I missing a trick here, or if this is the expected behavior, is there a way to override it?

+3
source share
2 answers

A model with sequential sequences that persist all the time is the expected behavior in accordance with this answer .

I have not tried β€œstoring a custom stone,” but it seems like it should be smart enough to detect this.

+3
source

, .

+1

All Articles