Skip to content

Commit

Permalink
fix tags case sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
llawlor committed Feb 17, 2015
1 parent c5b6e16 commit a63c2fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,15 @@ def save_tags(tags)
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)

# 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
Expand Down

0 comments on commit a63c2fa

Please sign in to comment.