-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove update_attribute. #6738
Remove update_attribute. #6738
Conversation
Historically, update_attribute and update_attributes are similar, but with one big difference: update_attribute does not run validations. These two methods are really easy to confuse given their similar names. Therefore, update_attribute is being removed in favor of update_column. See the thread on rails-core here: https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA
Nice! Always found this confusing and questioned the reasoning behind the difference in the first place. |
I don't think that |
Right, nobody claims that. Those differences are explained in the deprecation warning in 3.2, and in the CHANGELOG. |
#6739 is the one with the warning. :) |
I'm confused. The |
It was not removed yet. In fact it was but we reverted to better evaluate its usage. |
The method was removed about 2 years ago, but that change has since been reverted: rails/rails#6738 (comment) I also linked the method to its documentation on the RoR API docs: http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute
The method was removed about 2 years ago, but that change has since been reverted: rails/rails#6738 (comment) I also linked the method to its documentation on the RoR API docs: http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being removed in favor of
update_column.
See the thread on rails-core here:
https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA