app/services/nyauth/reset_password_request.rb in nyauth-0.7.0 vs app/services/nyauth/reset_password_request.rb in nyauth-0.7.1
- old
+ new
@@ -8,10 +8,10 @@
end
def save(options = {})
options.reverse_merge!(as: :user)
klass = options[:as].to_s.classify.constantize
- @client = klass.find_by!(email: @email)
+ @client = klass.with_given_email(@email).last!
@client.request_reset_password
rescue
errors.add(:base, :invalid_email)
end
end