Created
August 7, 2011 03:32
-
-
Save softwaregravy/1130030 to your computer and use it in GitHub Desktop.
Check User validations in the Registration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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