Skip to content

Instantly share code, notes, and snippets.

@softwaregravy
Created August 7, 2011 03:32
Show Gist options
  • Save softwaregravy/1130030 to your computer and use it in GitHub Desktop.
Save softwaregravy/1130030 to your computer and use it in GitHub Desktop.
Check User validations in the Registration
def require_email
errors.add(:email, "Email is required") unless email.present?
if email.present?
errors.add(:email, "Email is already taken") if email_in_use?(email)
end
errors.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment