On Thu, Mar 13, 2014 at 2:28 AM, Anh Nguyen <khac...@gmail.com> wrote:

I know, but the problem is that 'update_attribute' is misleading. I'm
> wondering why don't we just deprecate it and force people to use the better
> "update_column" instead. Or at least make "update_attribute" behave like
> "update_column".
>

Yes, that's totally understandable and historically there have been
discussions and some temptative steps towards it.

There was a time where #update_attribute was even removed from master:


https://github.com/rails/rails/commit/a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01

this was later reverted:


https://github.com/rails/rails/commit/50bdb924ba26999a468ec4844917cefec39ba08c

because a deprecation policy was being discussed.

Indeed, #update_attributes became deprecated because we felt
#update(attributes) was a better interface:


https://github.com/rails/rails/commit/2549a3b088de14c36d60de6c60c1374af75c326f

and albeit #update is considered to be the modern way to update a record,
the deprecation in the end was removed, and finally #update_attributes just
became an alias:


https://github.com/rails/rails/commit/1f3a1fedf951dbc4b72d178e2a649c4afd2f1566

Those are some commits to show your remarks resonate, but that's the tip of
the iceberg, as they suggest we've had many discussions about how to evolve
this API over the last year and a half or so. So, as you see, we sympathize
with the need of a deprecation in #update_attribute in particular, but by
now the state of the API is the outcome of everything taken in
consideration.

It could be the case that we revisit this topic in the future.

-- 
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