summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-09 23:21:35 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-09 23:21:35 -0400
commit05104c93a1b12845875691e7b97ea9d9239c8ef1 (patch)
treebbd9fb38032b7b74ff5c864fe822fb088ed2ae43
parent0cfbc1502bd1f04aac8a5c0a380230db98288540 (diff)
disallow spaces in usernames
-rw-r--r--app/models/user.rb2
-rw-r--r--db/seeds.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 462136f..46cd532 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -52,7 +52,7 @@ class User < ActiveRecord::Base
validates(:user_name,
presence: true,
length:{maximum: 50},
- format: {with: /\A[a-zA-Z0-9 _\-]+\z/},
+ format: {with: /\A[a-zA-Z0-9_-]+\z/},
uniqueness: {case_sensitive: false })
# password_digest:string
diff --git a/db/seeds.rb b/db/seeds.rb
index 608be9e..86bf42d 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -50,7 +50,7 @@ if Rails.env.development? or (ENV['FORCE_SEED'] and not ENV['FORCE_SEED'].empty?
players_for_league.push(User.create!(name: "M9Fumjaa" , password: "password", email: "M9Fumjaa@gmail.com" , user_name: "M9Fumjaa" ))
players_for_league.push(User.create!(name: "spikevsnaruto" , password: "password", email: "spikevsnaruto@gmail.com" , user_name: "spikevsnaruto" ))
players_for_league.push(User.create!(name: "GoogleMaSkills" , password: "password", email: "GoogleMaSkills@gmail.com" , user_name: "GoogleMaSkills" ))
- players_for_league.push(User.create!(name: "james chamberlan", password: "password", email: "jameschamberlan@gmail.com", user_name: "james chamberlan"))
+ players_for_league.push(User.create!(name: "james chamberlan", password: "password", email: "jameschamberlan@gmail.com", user_name: "jameschamberlan" ))
players_for_league.push(User.create!(name: "Kaceytron" , password: "password", email: "Kaceytron@gmail.com" , user_name: "Kaceytron" ))
# Semi-real users
@@ -70,7 +70,7 @@ if Rails.env.development? or (ENV['FORCE_SEED'] and not ENV['FORCE_SEED'].empty?
panda = User.create(name: "Panda" , password: "password", email: "panda@gmail.com" , user_name: "InspectorPanderp" )
mesa = User.create(name: "Mesataki" , password: "password", email: "mesataki@gmail.com" , user_name: "Mesakati" )
guntas_league = User.create(name: "TolkiensButt" , password: "password", email: "TolkiensButt@gmail.com" , user_name: "TolkiensButt" )
- lyra = User.create(name: "Lyra Heartstings" , password: "password", email: "LyraHeartstings@gmail.com" , user_name: "Lyra Heartstings" )
+ lyra = User.create(name: "Lyra Heartstings" , password: "password", email: "LyraHeartstings@gmail.com" , user_name: "LyraHeartstings" )
josh_league = User.create(name: "Josh_league" , password: "password", email: "josh_league@gmail.com" , user_name: "Joshoowah" )
jeff = User.create(name: "Jeff Linguinee" , password: "password", email: "jefflingueeneeeee@gmail.com" , user_name: "SenorJeffafa" )
sarah = User.create(name: "Sarah Lawson" , password: "password", email: "sarah@gmail.com" , user_name: "LittlexSurah" )