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 rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to