Class: ActiveRecord::Locking::LockingType
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
|
|
| Inherits: | Object |
| Defined in: | activerecord/lib/active_record/locking/optimistic.rb |
Overview
In de/serialize we change nil to 0, so that we can allow passing
nil values to lock_version, and not result in ::ActiveRecord::StaleObjectError
during update record.
Class Method Summary
- .new(subtype) ⇒ LockingType constructor
Instance Attribute Summary
::ActiveRecord::Type::QueryPredicates::Decorator - Included
::ActiveRecord::Type::QueryPredicates - Included
Instance Method Summary
::ActiveRecord::Type::QueryPredicates::Decorator - Included
::ActiveRecord::Type::QueryPredicates - Included
| #comparison_expression | Converts a stored attribute or serialized query value into the expression on which comparisons are performed. |
Constructor Details
.new(subtype) ⇒ LockingType
Instance Method Details
#deserialize(value)
[ GitHub ]# File 'activerecord/lib/active_record/locking/optimistic.rb', line 259
def deserialize(value) super.to_i end
#encode_with(coder)
[ GitHub ]# File 'activerecord/lib/active_record/locking/optimistic.rb', line 271
def encode_with(coder) coder["subtype"] = __getobj__ end
#init_with(coder)
[ GitHub ]# File 'activerecord/lib/active_record/locking/optimistic.rb', line 267
def init_with(coder) __setobj__(coder["subtype"]) end
#serialize(value)
[ GitHub ]# File 'activerecord/lib/active_record/locking/optimistic.rb', line 263
def serialize(value) super.to_i end
#subtype
[ GitHub ]# File 'activerecord/lib/active_record/locking/optimistic.rb', line 255
def subtype __getobj__ end