Class: ActiveRecord::Locking::LockingType

Inherits:
Type::Value
  • Object
show all
Defined in:
activerecord/lib/active_record/locking/optimistic.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#deserialize(value) ⇒ Object


188
189
190
191
# File 'activerecord/lib/active_record/locking/optimistic.rb', line 188

def deserialize(value)
  # `nil` *should* be changed to 0
  super.to_i
end

#encode_with(coder) ⇒ Object


201
202
203
# File 'activerecord/lib/active_record/locking/optimistic.rb', line 201

def encode_with(coder)
  coder['subtype'] = __getobj__
end

#init_with(coder) ⇒ Object


197
198
199
# File 'activerecord/lib/active_record/locking/optimistic.rb', line 197

def init_with(coder)
  __setobj__(coder['subtype'])
end

#serialize(value) ⇒ Object


193
194
195
# File 'activerecord/lib/active_record/locking/optimistic.rb', line 193

def serialize(value)
  super.to_i
end