Class: OpenLoam::RecordLock

Inherits:
TenantRecord
  • Object
show all
Defined in:
app/models/open_loam/record_lock.rb

Overview

An advisory "someone is editing this" lock on a record — the COURTESY layer. The real guarantee against a silent clobber is optimistic locking (lock_version, see OpenLoam::RecordLocks docs); this only warns the second editor. One lock per record, with a TTL: an expired lock is treated as free, and re-acquiring as the same holder extends it (a heartbeat). Plumbing, so not audited — like OpenLoam::ApiToken.

Instance Method Summary collapse

Instance Method Details

#expired? ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/models/open_loam/record_lock.rb', line 15

def expired?
  expires_at.nil? || expires_at <= Time.current
end