I know that in Rails you can call model.update_attribute :foo, 'bar'
and it will update just that one attribute in the db without validating the rest of the model. This causes one SQL transaction.
You can also set multiple attributes with .update_attributes
, but this cannot skip validations.
Or, you can call .save( :validate=>false )
and update the model without validation. However, this saves all the attributes on the model in their current state, rather than being able to limit this to certain columns.
My question is, is there any way to set more than one value on a model, but not all of them, without triggering validations, in a single SQL transaction?