I noticed in the Rails docs here that the update_attributes
method is deprecated:
This method is deprecated on the latest stable version of Rails. The last existing version (v2.3.8) is shown here.
I'm curious to know why it was deprecated and what is preferred in its place.
It isn't a matter of enormous consequence for me right now as the method works fine in my Rails 2.x apps. However, in anticipation of upgrading to Rails 3 some day I'd like to start getting a grasp on what I'll need to change and how things are done differently.
Apidock is a little misleading, it actually says "deprecated or moved"; the latter is true, the former is not. ActiveRecord::Base
includes ActiveRecord::Persistence
, which defines #update_attributes. You can view the docs for this on apidock at http://apidock.com/rails/ActiveRecord/Persistence/update_attributes.
While this is also in ActiveResource now, there's no shared implementation of update_attributes, and you shouldn't look there for ActiveRecord::Base-related documentation, or vice versa.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With