Class: Backframe::Reset
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Backframe::Reset
- Defined in:
- lib/backframe/models/reset.rb
Instance Method Summary collapse
Instance Method Details
#claim ⇒ Object
16 17 18 19 20 21 |
# File 'lib/backframe/models/reset.rb', line 16 def claim self.claimed_at = Time.zone.now self.is_active = false self.save self.user.update_attributes(:is_active => true, :activated_at => Time.zone.now) end |
#expired? ⇒ Boolean
23 24 25 |
# File 'lib/backframe/models/reset.rb', line 23 def expired? !self.is_active end |
#url ⇒ Object
27 28 29 30 |
# File 'lib/backframe/models/reset.rb', line 27 def url return "#{Rails.application.config.root_url}/admin/reset/#{self.token}" if self.user_type == 'Admin' return "#{Rails.application.config.root_url}/account/reset/#{self.token}" if self.user_type == 'Customer' end |