class TagTaggable < ApplicationRecord

belongs_to :tag
belongs_to :taggable, :polymorphic => true




before_destroy do
	puts self.tag
	if self.tag
		Tag.find(self.tag_id).destroy if self.tag.tag_taggables.size == 1 
	end
end

end
