But I want to notice, that column != attribute in common case, for example:

> User.first.update_column :password, '123123'
  SQL (0.2ms)  UPDATE "users" SET "password" = '123123' WHERE "users"."id" 
= 1
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: 
password: UPDATE "users" SET "password" = '123123' WHERE "users"."id" 

> User.first.update_attribute :password, '123123'
   (0.4ms)  UPDATE "users" SET "password_digest" = 
'$2a$10$x3GxNtIEClpqJD1kwGKFneOWh6v9JJbdeb9KW36qN8R2oPdcr/hPG', 
"updated_at" = '2012-08-09 13:38:53.459408' WHERE "users"."id" = 1

среда, 13 июня 2012 г., 19:37:52 UTC+4 пользователь MikeGehard написал:

> Greetings all,
>
> I would like to start a conversation about the subtle difference between 
> update_attribute and update_attributes, namely that update_attribute skips 
> validations and update_attributes does not skip validations.
>
> I know this has been around for a while but is Rails 4 the time to make 
> them both respect validations? I am willing to do the work if the core team 
> feels like it would be a worthwhile breaking change.
>
> I don't have a ton of context on the history but as I talk to more and 
> more beginners (and advanced) Rails folks, that subtle difference does trip 
> people up. 
>
> Thanks,
> Mike
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/6KLIU1Jn2mMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to