The functions are already there : https://github.com/LessonPlanet/acts-as-taggable-on/blob/handle-race-condition-adding-tags/lib/acts_as_taggable_on/utils.rb