Move comment up to the class, for both of the methods, and document on class level why we are doing this.

[ci skip]
This commit is contained in:
Vipul A M 2016-05-01 02:44:52 +05:30
parent 9d1bf059c0
commit 7b37e3edaf

@ -184,9 +184,12 @@ def inherited(subclass)
end
end
# 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 LockingType < DelegateClass(Type::Value) # :nodoc:
def deserialize(value)
# `nil` *should* be changed to 0
super.to_i
end