Module: Devise::Models::Latcheable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise_latcheable/model.rb
Instance Method Summary collapse
- #latch_enable ⇒ Object
- #latch_enabled? ⇒ Boolean
- #latch_pair! ⇒ Object
- #latch_unlocked? ⇒ Boolean
- #latch_unpair! ⇒ Object
Instance Method Details
#latch_enable ⇒ Object
45 46 47 |
# File 'lib/devise_latcheable/model.rb', line 45 def latch_enable self.latch_enabled = true if Devise::Latch.config['always_enabled'] == true end |
#latch_enabled? ⇒ Boolean
18 19 20 |
# File 'lib/devise_latcheable/model.rb', line 18 def latch_enabled? latch_enabled end |
#latch_pair! ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/devise_latcheable/model.rb', line 34 def latch_pair! return true unless latch_enabled? self.latch_account_id = Devise::Latch.pair pair_code if latch_account_id.nil? errors.add(:base, 'Invalid latch pair code') return false end end |