Rename callback for clarity

This commit is contained in:
Katrina Owen 2013-02-19 07:54:09 -07:00
parent f56fc1945c
commit bb88674856

View file

@ -8,12 +8,11 @@ class Tagging < ActiveRecord::Base
belongs_to :tag
belongs_to :taggable, :polymorphic => true, :touch => true
after_destroy :after_destroy
after_destroy :delete_orphaned_tag
private
# This callback makes sure that an orphaned <tt>Tag</tt> is deleted if it no longer tags anything.
def after_destroy
def delete_orphaned_tag
tag.destroy if tag and tag.taggings.count == 0
end