Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check user and email
validate do |model|
if user
model.errors.add :password, 'is invalid' unless user.authenticate password
else
model.errors.add :email, 'not found'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment