Class: ActiveRecord::Locking::LockingType
- Inherits:
-
Type::Value
- Object
- ActiveRecord::Locking::LockingType
- Defined in:
- lib/active_record/locking/optimistic.rb
Overview
:nodoc:
Instance Method Summary collapse
- #deserialize(value) ⇒ Object
- #encode_with(coder) ⇒ Object
- #init_with(coder) ⇒ Object
- #serialize(value) ⇒ Object
Instance Method Details
#deserialize(value) ⇒ Object
188 189 190 191 |
# File '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 'lib/active_record/locking/optimistic.rb', line 201 def encode_with(coder) coder['subtype'] = __getobj__ end |
#init_with(coder) ⇒ Object
197 198 199 |
# File 'lib/active_record/locking/optimistic.rb', line 197 def init_with(coder) __setobj__(coder['subtype']) end |
#serialize(value) ⇒ Object
193 194 195 |
# File 'lib/active_record/locking/optimistic.rb', line 193 def serialize(value) super.to_i end |