I have hstore column (email_subscribing) in model. And have strore_accessor
I want to check changes of one key from this store on after_update callback
store_accessor :email_subscribing, :common_users_list, :admins_list, :caretakers_list, :tenant_admins_list, :managers_list
after_update :update_mailchimp_subscriptions, if: :email_ep_updates_changed?
But get an error - undefined method `email_ep_updates_changed?'
What is the solution?
I think that the answer that you're looking for can be found here in this previous post:
How to determine if any field in a model / nested model changed?
The method name email_ep_updates_changed? doesn't appear to exist but you should be able to accomplish what you're setting out to do via the post above. You just need to add the _changed? to the end of the attribute name of what it is that you're checking or use .changed? on the actual Model itself if you're not looking for a specific attribute.
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