Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding dirty tracking #798
This will add a dirty flag to objects.
New objects, that are built but not saved, will be flagged as dirty until they are saved.
As this tracking is hooked into the setters of the objects, it originally got flagged as dirty every time an object was created or built/saved, because id, createdAt, touchedAt, and updatedAt would be set, which I wrote check for. This is not the most beautiful thing to do, but I haven't found an alternative way of doing this.
Tested with MySQL and SQLite.
Dude, we were just talking about this on IRC last night, was about to do it xD although some of your postgres tests fails, send me a ping when it's fixed :) Very cool dude, and thanks for your awesome work.
@mstorgaard Could you do me a huge favor? And change all of the assertions to check for true/false instead of falsy/truthy since you're using straight booleans? :) Should just be
I did a quick glance at your code and it seems fairly solid, again thanks :)
Solid work, me and @sdepold was just discussing this a little bit on IRC, it definitely has my approval, but I'll bring this to his attention to see if he had something else in mind (I don't think so personally but I'd like to double check on this). Again, thanks for the PR! :) Huge win for Sequelize