From a63c2fa774864344501e9e818d4149a5c8599804 Mon Sep 17 00:00:00 2001 From: Lee Lawlor Date: Tue, 17 Feb 2015 09:03:00 -0500 Subject: [PATCH] fix tags case sensitivity --- app/models/channel.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/channel.rb b/app/models/channel.rb index 5bdf0e0..7663c3f 100644 --- a/app/models/channel.rb +++ b/app/models/channel.rb @@ -435,7 +435,7 @@ class Channel < ActiveRecord::Base def remove_tags(tags) tag_array = tags.split(',') # remove white space - tag_array = tag_array.collect {|t| t.strip } + tag_array = tag_array.collect {|t| t.strip.downcase } # get all taggings for this channel taggings = Tagging.where(channel_id: self.id).includes(:tag) @@ -443,7 +443,7 @@ class Channel < ActiveRecord::Base # check for existence taggings.each do |tagging| # if tagging is not in list - if !tag_array.include?(tagging.tag.name) + if !tag_array.include?(tagging.tag.name.downcase) # delete tagging tagging.delete end