True. I somehow overlooked the fact that update_attribute saves dirty attributes. Xavier, you said the purpose of update_attribute "was" to save quick stuff, are there plans to deprecate this behavior?
On Wed, Mar 12, 2014 at 4:10 PM, Xavier Noria <[email protected]> wrote: > The point is that dirty attributes get persisted, not just the one you > set. That is, the (invalid) username was saved because validations are > skipped and the model as such is saved. > > Persisting dirty attributes is not an overlook, callbacks are run so you > need to take the model as a whole and store it as a whole, with its current > state, with all its consequences. > > The purpose of update_attribute was to save quick stuff, a flag toggle... > that kind of things. Nowadays you'd generally use update_column. > > Xavier > > PS: Of course all this is documented, but we are discussing semantics, not > documented behaviour. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/d/optout. > -- Mohamed Wael Khobalatte -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
