emilsjolander / sprinkles

Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications
Apache License 2.0
772 stars 84 forks source link

ContentValues retrieved before beforeCreate is invoked #39

Closed datadanne closed 10 years ago

datadanne commented 10 years ago

Model.save retrieves all ContentValues before invoking beforeCreate() which breaks fields that are not nullable but are initialized in beforeCreate(). An example of this can be seen in the sample where a Note cannot be saved because of a NullPointerException thrown by the DateSerializer for the field createdAt.

datadanne commented 10 years ago

The issue was introduced in f1d4fcc51d7b6f6e27e500b633db0901e76ec438.

emilsjolander commented 10 years ago

Good catch! I'll close this issue and we'll continue any conversations in the pull request issues by @zsiegel