From ba0b145820b29719e6bc9724d9d91682e4118686 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Mar 2014 15:29:16 -0500 Subject: foo --- app/models/game.rb | 1 + app/models/user.rb | 18 ++---------------- 2 files changed, 3 insertions(+), 16 deletions(-) (limited to 'app/models') diff --git a/app/models/game.rb b/app/models/game.rb index a181c26..b3b6977 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -1,2 +1,3 @@ class Game < ActiveRecord::Base + has_many :game_attributes end diff --git a/app/models/user.rb b/app/models/user.rb index 23caf84..bd96223 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -13,26 +13,12 @@ class User < ActiveRecord::Base ## # VAILD_EMAIL is the regex used to validate a user given email. - # - # A break down of the regex is listed below. - # - # / -------------> Start of the regex - # \A ------------> match start of a string - # [\w+\-.]+ -----> at least one word character, plus, hyphen, - # or dot - # @ -------------> literal ampersand - # [a-z\d\-.]+ ---> at least one letter, digit, hyphen, or dot - # (?:\.[a-z]+) --> ensures that the error of example@foo..com - # does not occur - # \z ------------> match end of a string - # / -------------> end of the regex - # i -------------> case insensitive - VALID_EMAIL_REG = /\A[\w+\-.]+@[a-z\d\-.]+(?:\.[a-z]+)\z/i + VALID_EMAIL_REG = /^\S+@\S+\.\S+$/i ## # VALID_USER_NAME checks to make sure a user's user_name # is in the proper format. - VALID_USER_NAME_REG = /[a-zA-Z0-9\-]/ + VALID_USER_NAME_REG = /^[a-zA-Z0-9\-]+$/ ## # The following lines put a user account through a series of -- cgit v1.2.3-54-g00ecf