Class: Spotlight::Lock
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::Lock
- Defined in:
- app/models/spotlight/lock.rb
Overview
Page-level locking to discourage update conflicts
Instance Method Summary collapse
Instance Method Details
#current_session! ⇒ Object
10 11 12 |
# File 'app/models/spotlight/lock.rb', line 10 def current_session! @current_session = true end |
#current_session? ⇒ Boolean
14 15 16 |
# File 'app/models/spotlight/lock.rb', line 14 def current_session? !!@current_session end |
#stale? ⇒ Boolean
18 19 20 |
# File 'app/models/spotlight/lock.rb', line 18 def stale? created_at < (Time.zone.now - 12.hours) end |