Exception: DataMapper::Lock::StaleRecordError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dm-lock/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stale, latest) ⇒ StaleRecordError

Initialize with stale and latest records.



19
20
21
22
# File 'lib/dm-lock/exceptions.rb', line 19

def initialize stale, latest
  @stale_record, @current_record = stale, latest
  super 'record has been altered'
end

Instance Attribute Details

#current_recordObject (readonly)

Record as-is current in the database.



9
10
11
# File 'lib/dm-lock/exceptions.rb', line 9

def current_record
  @current_record
end

#stale_recordObject (readonly)

Stale record attempted to be destroyed or saved.



14
15
16
# File 'lib/dm-lock/exceptions.rb', line 14

def stale_record
  @stale_record
end