Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Allow changing model attributes in the beforeSave and beforeUpdate callbacks of updateAttributes #102
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.