couchbaselabs/CouchCocoa — pull request #73 by martijnwalraven (2013-08-05 07:01:06+00:00)
Title: Don't try to decode the old NSData or NSDate values when the property has been set to nil

After setting an existing 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.