Class: People::EmailHash
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- People::EmailHash
- Defined in:
- app/models/people/email_hash.rb
Class Method Summary collapse
- .email_confirm ⇒ Object
- .expiration_minutes ⇒ Object
- .expired?(email_hash) ⇒ Boolean
- .forgotten_password ⇒ Object
Instance Method Summary collapse
Class Method Details
.email_confirm ⇒ Object
21 22 23 |
# File 'app/models/people/email_hash.rb', line 21 def self.email_confirm return 1 end |
.expiration_minutes ⇒ Object
29 30 31 |
# File 'app/models/people/email_hash.rb', line 29 def self.expiration_minutes return 360 end |
.expired?(email_hash) ⇒ Boolean
33 34 35 36 37 38 39 40 41 |
# File 'app/models/people/email_hash.rb', line 33 def self.expired?(email_hash) date = email_hash.created_at.utc + ::People::EmailHash.expiration_minutes.minutes if ::Time.now.utc > date self.destroy return true else return false end end |
.forgotten_password ⇒ Object
25 26 27 |
# File 'app/models/people/email_hash.rb', line 25 def self.forgotten_password return 2 end |
Instance Method Details
#setup_email_hash ⇒ Object
14 15 16 17 18 19 |
# File 'app/models/people/email_hash.rb', line 14 def setup_email_hash if self.token.nil? || self.token.blank? self.token = ::Devise.friendly_token end return true end |