Class: Ditty::IdentityPolicy
Defined Under Namespace
Classes: Scope
Instance Attribute Summary
#record, #user
Instance Method Summary
collapse
#initialize
Instance Method Details
#forgot_password? ⇒ Boolean
11
12
13
|
# File 'lib/ditty/policies/identity_policy.rb', line 11
def forgot_password?
true
end
|
#login? ⇒ Boolean
7
8
9
|
# File 'lib/ditty/policies/identity_policy.rb', line 7
def login?
true
end
|
#permitted_attributes ⇒ Object
19
20
21
|
# File 'lib/ditty/policies/identity_policy.rb', line 19
def permitted_attributes
%i[username password password_confirmation]
end
|
#reset_password? ⇒ Boolean
15
16
17
|
# File 'lib/ditty/policies/identity_policy.rb', line 15
def reset_password?
record.new? || (record.reset_requested && record.reset_requested > (Time.now - (24 * 60 * 60)))
end
|