Class: Panda::Core::UserSession
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Panda::Core::UserSession
- Includes:
- HasUUID
- Defined in:
- app/models/panda/core/user_session.rb
Instance Method Summary collapse
-
#revoke!(admin:) ⇒ Object
Revoke a session (e.g. admin force-logout).
-
#touch_activity! ⇒ Object
Update last activity timestamp.
Instance Method Details
#revoke!(admin:) ⇒ Object
Revoke a session (e.g. admin force-logout)
21 22 23 24 25 26 27 |
# File 'app/models/panda/core/user_session.rb', line 21 def revoke!(admin:) update!( active: false, revoked_at: Time.current, revoked_by: admin ) end |
#touch_activity! ⇒ Object
Update last activity timestamp
30 31 32 |
# File 'app/models/panda/core/user_session.rb', line 30 def touch_activity! update!(last_active_at: Time.current) end |