Class: BackOffice::Reset
Instance Attribute Summary collapse
Attributes inherited from Password
#email, #plaintext, #plaintext_confirmation
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Password
#update, #user
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
3
4
5
|
# File 'lib/back_office/reset.rb', line 3
def token
@token
end
|
Class Method Details
.find(token) ⇒ Object
7
8
9
10
11
|
# File 'lib/back_office/reset.rb', line 7
def self.find(token)
if email = BackOffice.decrypt(token)
new(email: email, token: token)
end
end
|
Instance Method Details
#save ⇒ Object
17
18
19
20
21
22
|
# File 'lib/back_office/reset.rb', line 17
def save
if token.nil? && valid?(:create)
@token = BackOffice.encrypt(email)
true
end
end
|
#to_param ⇒ Object
13
14
15
|
# File 'lib/back_office/reset.rb', line 13
def to_param
token
end
|