Skip to content

Instantly share code, notes, and snippets.

@superacidjax
Created December 1, 2012 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superacidjax/4185151 to your computer and use it in GitHub Desktop.
Save superacidjax/4185151 to your computer and use it in GitHub Desktop.
validates :first_name, presence: true, length: { maximum: 50 }
validates :last_name, presence: true, length: { maximum: 50 }
validates :name, presence: true, length: { maximum: 50 },
uniqueness: { case_sensitive: false }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
validates :password, length: { minimum: 6 }
validates :password_confirmation, presence: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment