class BackOffice::Reset

Attributes

token[R]

Public Class Methods

find(token) click to toggle source
# File lib/back_office/reset.rb, line 7
def self.find(token)
  if email = BackOffice.decrypt(token)
    new(email: email, token: token)
  end
end

Public Instance Methods

save() click to toggle source
# File lib/back_office/reset.rb, line 17
def save
  if token.nil? && valid?(:create)
    @token = BackOffice.encrypt(email)
    true
  end
end
to_param() click to toggle source
# File lib/back_office/reset.rb, line 13
def to_param
  token
end

Private Instance Methods

user_existence() click to toggle source
# File lib/back_office/reset.rb, line 26
def user_existence
  errors.add(:email, :not_registered) unless user
end