Basic creation of initial site

This commit is contained in:
Kyle Drake 2013-06-02 23:08:48 -07:00
parent 0aaf894fa3
commit 5deb20e264
5 changed files with 54 additions and 3 deletions

View file

@ -1,5 +1,6 @@
class Site < Sequel::Model
MINIMUM_PASSWORD_LENGTH = 5
USERNAME_REGEX = /[^\w-]/i
many_to_one :server
many_to_many :tags
@ -59,7 +60,7 @@ class Site < Sequel::Model
errors.add :over_capacity, 'We are currently at capacity, and cannot create your home page. We will fix this shortly. Please come back later and try again, our apologies.'
end
if values[:username].nil? || values[:username].empty? || values[:username].match(/[^\w.-]/i)
if values[:username].nil? || values[:username].empty? || values[:username].match(USERNAME_REGEX)
errors.add :username, 'A valid username is required.'
end