Rails updateattributes not updating timestamp


User 1 checks the box to make the employee a manager and submits the form.

The form parameters that are posted are: The record will be updated, and the lock_version incremented to 2.

The fact that the boolean may belong to the invoices table is irrelevant from a REST viewpoint. @fxn I agree that concept and implementation are two different things.

Unlike the save method, you can’t pass false to update_attributes to tell it to skip validation.

Updates all records in the current relation with details given.

Therefore, the notion or exposal of column confuses me in an Active Record model. update_attribute could be called on a new record, update_column can't.

Active Record should abstract the connection between physical and logical representation, in my eyes.

update_column does not perform callbacks including updating the timestamp as update_attribute does.

Not defending update_attribute here, just suggesting the solution might not have been the perfect one, at least in my opinion.

This means your comment be automatically sent into moderation and you won't receive emails when a user replies.

Take a look at our Privacy Policy for more details.

The PUT method is already defined to overwrite a resource with a complete new body, and cannot be reused to do partial changes.

Otherwise, proxies and caches, and even clients and servers, may get confused as to the result of the operation. Furthermore, PATCH should be made the default form method when editing existing model records, since 99% of the time, users want to modify an existing record instead of replacing it.

You must have an account to comment. Please register or login here!