Class: ActiveRecord::Locking::LockingType

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#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

#type_cast_from_database(value) ⇒ Object


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

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