Using Rails 3 I have a number of model containing serialized attributes. To perform the serialization I'm currently using 3 different techniques - the serialize method; activerecord store; and store configurable gem.
In all cases, when I save a model instance the serialized attribute is updated even if the content is unchanged. This was a surprising discovery particularly when using the store configurable gem as the readme states:
"StoreConfigurable is smart enough to let your parent object know when it changes. It is not dumb either. It will only trigger changes if the values you set are different, are new, or change the configs state."
Am I missing a trick here or if this is the expected behaviour is there a way to override it?
Model with serialized columns being saved all the time is the expected behaviour according to this answer.
I haven't tried "store configurable gem" but it sounds like it should be smart enough to detect that.
I have similar issue so before updating i am resetting all the values and let new values to be entered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With