This commit is contained in:
Kyle Drake 2014-04-11 15:51:09 -07:00
parent 7cd7973144
commit d8da8de5b3
No known key found for this signature in database
GPG key ID: 8BE721072E1864BE
4 changed files with 127 additions and 32 deletions

View file

@ -73,10 +73,11 @@ class Site < Sequel::Model
end
def new_tags=(tags_string)
tags_string.gsub! /[^a-zA-Z0-9, ]/, ''
tags_string.gsub! ', ', ','
tags = tags_string.split ','
tags_string.gsub! /[^a-zA-Z0-9, ]/, ''
tags.collect! {|c| (c.match(/^\w+\s\w+/) || c.match(/^\w+/)).to_s }
@new_tag_strings = tags
@new_tag_strings = tags.sort
end
def before_validation