| In: |
app/models/page_lock.rb
|
Contains all the lock methods to be mixed in with the page
| LOCKING_PERIOD | = | 30 * 60 |
# File app/models/page_lock.rb, line 5 5: def lock(time, locked_by) 6: @locked_at, @locked_by = time, locked_by 7: end
# File app/models/page_lock.rb, line 9
9: def lock_duration(time)
10: ((time - @locked_at) / 60).to_i unless @locked_at.nil?
11: end
# File app/models/page_lock.rb, line 17
17: def locked?(comparison_time)
18: @locked_at + LOCKING_PERIOD > comparison_time unless @locked_at.nil?
19: end