If you want to maintain separation you could add after_update and
after_destroy callbacks that only send a message using
ActiveSupport:notifications.
You then write a subscriber to that notification which zaps the cache.
Same result, but instead of observing, it listens. It also makes it
explicit in your model code that after update and destroy a message is
sent into the system which may be acted upon.
> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
>
rubyonrails-ta...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/rubyonrails-talk/-/tpPLDCE1jakJ.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>