one word tags, fix captcha two word mention

This commit is contained in:
Kyle Drake 2014-07-21 15:19:15 -05:00
parent 9cedbd086d
commit ba840423a6
5 changed files with 10 additions and 10 deletions

View file

@ -425,12 +425,12 @@ class Site < Sequel::Model
end
if tag.match(/ /)
errors.add :tags, "Tag \"#{tag}\" cannot have more than one space between words."
errors.add :tags, "Tag \"#{tag}\" cannot have spaces."
break
end
if tag.split(' ').length > Tag::NAME_WORDS_MAX
errors.add :tags, "Tag \"#{tag}\" cannot be more than two words."
errors.add :tags, "Tag \"#{tag}\" cannot be more than #{Tag::NAME_WORDS_MAX} word."
break
end

View file

@ -1,6 +1,6 @@
class Tag < Sequel::Model
NAME_LENGTH_MAX = 20
NAME_WORDS_MAX = 2
NAME_WORDS_MAX = 1
many_to_many :sites
def before_create