Skip to content

Instantly share code, notes, and snippets.

@voleoo
Last active December 19, 2015 14:58
Show Gist options
  • Save voleoo/5972678 to your computer and use it in GitHub Desktop.
Save voleoo/5972678 to your computer and use it in GitHub Desktop.
validates :email, :password, presence: true
validates :password, length: { in: 6..20 }
validates :email, confirmation: true
validates :email, format: { with: /\A[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})\Z/, :message => "Only emails allowed" }
validates :email, uniqueness: true
validates :credit_card, length: { is: 16 }
validates :price, numericality: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment