Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acts_as_taggable changes in after_commit callback? #475

Open
concept47 opened this issue Feb 1, 2014 · 4 comments
Open

acts_as_taggable changes in after_commit callback? #475

concept47 opened this issue Feb 1, 2014 · 4 comments

Comments

@concept47
Copy link

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)

@seuros
Copy link
Collaborator

seuros commented Feb 1, 2014

I'm not totally sure, but if you use cache, the cache column will be changed.

@pioz
Copy link

pioz commented Nov 22, 2018

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.

@brentgreeff
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants