1602/jugglingdb — pull request #102 by kennu (2012-07-10 19:47:01+00:00)
Title: Allow changing model attributes in the beforeSave and beforeUpdate callbacks of updateAttributes

This patch tracks what model attributes are changed inside the beforeSave() and beforeUpdate() callbacks, when the model is updated by updateAttributes(). It then updates also them to the database backend. Previously any changes would be just lost.

RailwayJS's auto-generated controller code uses updateAttributes() to save modified items. So without this patch, adding a beforeSave() or beforeUpdate() callback (to modify some attributes) has no effect, which is pretty confusing.

I believe that by applying this patch the functionality becomes similar to how Ruby on Rails works in this situation.