Skip to content
Snippets Groups Projects
Commit 2067c83e authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

add function to update tags in learning objects put

parent 5313a125
No related branches found
No related tags found
No related merge requests found
......@@ -45,4 +45,10 @@ module Tagger
Tagging.where(tagger: self, tag: tag, taggable: taggable).destroy_all
end
end
def update_tags(taggable, with: [])
old_tags = taggable.tags.map { |t| t.name }
tag(taggable, with: with - old_tags)
untag(taggable, with: old_tags - with)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment