Add tagged_ids to taggable

This commit is contained in:
chris committed 2013-05-03 12:12:19 +08:00
1 parent 167a71272a
commit aefd62da2a
3 files changed
+36 -18

No files matched your search

+8
View File
@@ -6,4 +6,12 @@ class Tagging
belongs_to :tag
belongs_to :taggable, polymorphic: true
before_destroy :update_taggable_tag_ids
private
def update_taggable_tag_ids
self.taggable.remove_id(self.tag.id)
end
end