Class: Masks::Rails::Device
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Masks::Rails::Device
- Defined in:
- app/models/masks/rails/device.rb
Instance Method Summary collapse
Instance Method Details
#known? ⇒ Boolean
18 19 20 |
# File 'app/models/masks/rails/device.rb', line 18 def known? session.device&.known? end |
#reset_version ⇒ Object
26 27 28 |
# File 'app/models/masks/rails/device.rb', line 26 def reset_version self.version = SecureRandom.hex end |
#session_key ⇒ Object
22 23 24 |
# File 'app/models/masks/rails/device.rb', line 22 def session_key Digest::SHA512.hexdigest([key, version].join("-")) end |