mbleigh / acts-as-taggable-on

A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
http://mbleigh.lighthouseapp.com/projects/10116-acts-as-taggable-on
MIT License
4.96k stars 1.2k forks source link

Tagging.remove_unused_tags should gracefully handle already deleted tags #988

Open irphilli opened 4 years ago

irphilli commented 4 years ago

Together with https://github.com/salsify/goldiloader, I noticed that the order of how tags/taggings are deleted can cause the remove_unused_tags callback to be called multiple times. This is normally fine, however, the callback performs a reload on a tag, and that tag may have already been deleted. remove_unused_tags should gracefully handle already deleted tags.