AlexDenisov / iActiveRecord

ActiveRecord for iOS without CoreData, only SQLite
http://alexdenisov.github.com/iActiveRecord/
MIT License
354 stars 50 forks source link

Properties edited after having sent the first save message are not actually saved to the db #10

Closed fedefrappi closed 12 years ago

fedefrappi commented 12 years ago

The code for keeping track of the edited fields of an object wasn't called if they were changed through the default synthesized setters, but only when calling the setValue:forKey: method. This caused the property changes to be serialized only at the first call of the save method, when all the fields are marked as edited. I added a KVO observer for each column of an ActiveRecord object and commented out the now redundant setValue:ForKey: override.

AlexDenisov commented 12 years ago

Thank for help.

AlexDenisov commented 12 years ago

Please, before you open Pull Request try to run UnitTests target.

fedefrappi commented 12 years ago

Of course Alex, I'll do it the next time ;) Is there something wrong with this pull request?

AlexDenisov commented 12 years ago

Tests are failed, so now it's doesn't work as needed. But I'll fix this later. I found this bug in the experimental branch and fix it, but forgot to merge with master. In any case, thanks for contributing ;-)

fedefrappi commented 12 years ago

I'm sorry about that! Thanks to you for your library, it makes working with sqlite much easier!