From bba781c5be2171a947a1927fb084eddbbea4d6a0 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sat, 7 May 2016 22:20:23 +0000 Subject: [PATCH] Fix for tag remove issues --- app/tags.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/tags.rb b/app/tags.rb index a0431762..fc806f14 100644 --- a/app/tags.rb +++ b/app/tags.rb @@ -16,7 +16,10 @@ post '/tags/remove' do if params[:tags].is_a?(Array) DB.transaction { - params[:tags].each {|tag| current_site.remove_tag Tag[name: tag]} + params[:tags].each do |tag| + tag_to_remove = current_site.tags.select {|t| t.name == tag}.first + current_site.remove_tag(tag_to_remove) if tag_to_remove + end } end