Class: Tagging

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/tagging.rb

Instance Method Summary collapse

Instance Method Details

#before_destroyObject

good housekeeping idea from tags extension. if all the taggings for a particular tag are deleted, we want to delete the tag too



46
47
48
# File 'app/models/tagging.rb', line 46

def before_destroy
  tag.destroy_without_callbacks if Tagging.with(tag).count < 1
end