Class: ErpTechSvcs::Sessions::DeleteExpiredSessionsService
- Inherits:
-
Object
- Object
- ErpTechSvcs::Sessions::DeleteExpiredSessionsService
- Defined in:
- lib/erp_tech_svcs/sessions/delete_expired_sessions_service.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ DeleteExpiredSessionsService
constructor
A new instance of DeleteExpiredSessionsService.
Constructor Details
#initialize ⇒ DeleteExpiredSessionsService
Returns a new instance of DeleteExpiredSessionsService.
5 6 7 |
# File 'lib/erp_tech_svcs/sessions/delete_expired_sessions_service.rb', line 5 def initialize @session_age = ErpTechSvcs::Config.session_expires_in_hours.hours end |
Instance Method Details
#execute ⇒ Object
9 10 11 |
# File 'lib/erp_tech_svcs/sessions/delete_expired_sessions_service.rb', line 9 def execute ActiveRecord::SessionStore::Session.delete_all ['updated_at < ?', @session_age.ago] end |