After setting an existing data or date property to nil on a CouchModel, attempts to get the value continue to use the decoded raw value. It turns out cacheValue:ofProperty:changed: removes the value from the _properties dictionary, but getDataProperty: and getDateProperty: will try to decode the old raw value again if the property value is nil. In getValueOfProperty: there is an extra check to see if the model is new or if the property has been changed. Putting the same checks in getDataProperty: and getDateProperty: seems to solve the problem.
After setting an existing data or date property to nil on a CouchModel, attempts to get the value continue to use the decoded raw value. It turns out
cacheValue:ofProperty:changed:
removes the value from the_properties
dictionary, butgetDataProperty:
andgetDateProperty:
will try to decode the old raw value again if the property value is nil. IngetValueOfProperty:
there is an extra check to see if the model is new or if the property has been changed. Putting the same checks ingetDataProperty:
andgetDateProperty:
seems to solve the problem.