Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 28, 2019 11:32
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 MaryKuz/7c9c45dc0271a5c89115d8358e3ebf95 to your computer and use it in GitHub Desktop.
Save MaryKuz/7c9c45dc0271a5c89115d8358e3ebf95 to your computer and use it in GitHub Desktop.
Write validations in the model User
class User < ActiveRecord::Base
has_secure_password
validates :name, presence: true
validates :email, presence: true, uniqueness: { case_sensitive: false }, email: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment