Open concept47 opened 10 years ago
I'm not totally sure, but if you use cache, the cache column will be changed.
It would be nice if previous_chages[:tag_list]
also worked without column cache. Now the value of previous_changes[:tag_list]
seems to work in half way: the first element is always nil
while the second element of the array is correct.
@pioz That issue may be a limitation of Rails 5+:
I am using this gem with RailsAdmin, - I have got partial caching for my Taggable model, - if I save taggable, everything is great, when I assign to tag_list Taggable is saved and the cache is invalidated. BUT when the tag model is changed in RailsAdmin the cache is not invalidated.
How can I run code when a Tag is saved?
I tried to monkey patch ActsAsTaggableOn::Tag with a callback but it doesnt work.
I am starting to think that I need to remove RailsAdmin or at least write my own admin for saving tags, or I need to write a sweeper to check which tags have been changed in the past hour.
Is there a way to get a hold of changes from acts_as_taggable in the after_commit callback? Rails provides the previous_changes Hash for ActiveRecord object and was just wondering if acts-as-taggable had anything like it (I know of the _list_changed? method on acts_as taggable objects)