Add tagged_ids to taggable
This commit is contained in:
1 parent
167a71272a
commit
aefd62da2a
3 files changed
+36
-18
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user