Sha256: 1340926d0b21aae0f243653bbf2a1b842fbdf940f10ab43c2e5056b26f240e78
Contents?: true
Size: 454 Bytes
Versions: 12
Compression:
Stored size: 454 Bytes
Contents
class Auth::SendPasswordResetLinkForm < ApplicationForm attr_accessor :email validates :email, presence: true, email: true def send_reset_link? return false if invalid? user = User.find_by(email: @email) if user.nil? errors.add(:email, message: "We can't find a user with that email address.") return false end user.send_password_reset_notification(user.generate_token_for(:password_reset)) true end end
Version data entries
12 entries across 12 versions & 1 rubygems