Expected Behavior:
After successfully updating a record using .update(), the record's updated_at
field should auto-update to the current time.
Note: I changed the autoUpdatedAt setting (also mentioned here) using autoUpdatedAt: 'updated_at'
in config.models so the field is titled updated_at
instead of updatedAt
. It should still have the same functionality I would assume.
Actual Behavior:
The model successfully updates, but it does not update the updated_at
field.
Code Run:
model.update(primary, data)
.then(function updateCB(updated){
// error handling
sails.log('Updated successfully');
sails.log(updated);
});
Questions:
- Why is this?
- How do I fix this?
Result: Issue for Sails
I was able to reproduce it on a new project, so it looks like it's a problem with sails. Issue link: https://github.com/balderdashy/sails/issues/3821
See my answer below for more info.