Skip to content
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

Rename update_attributes method to update #8705

Merged
merged 5 commits into from Jan 3, 2013

Conversation

Projects
None yet
6 participants
@amparo-luna
Copy link
Contributor

amparo-luna commented Jan 2, 2013

Rename update_attributes to update, keep update_attributes as an alias for update method. This is a soft-deprecation for update_attributes, although it will still work without any deprecation message in 4.0 is recommended to start using update since update_attributes will be deprecated and removed in future versions of Rails.

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Jan 2, 2013

Guys, remember to use the Ruby 1.9 hash syntax

@guilleiguaran

This comment has been minimized.

Copy link
Member

guilleiguaran commented Jan 2, 2013

thanks @rafaelfranca, will update this

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Jan 2, 2013

Some tests using update_attributes and update_attributes! would be great, to make sure the alias will not be removed.

@rafaelfranca

This comment has been minimized.

Copy link
Member

rafaelfranca commented Jan 2, 2013

It is very good. Awesome work guys 👏

@carlosantoniodasilva

This comment has been minimized.

Copy link
Member

carlosantoniodasilva commented Jan 2, 2013

Looking great 👍

@guilleiguaran

This comment has been minimized.

Copy link
Member

guilleiguaran commented Jan 3, 2013

Thanks guys, everything updated, I'm merging this 😄

guilleiguaran added a commit that referenced this pull request Jan 3, 2013

Merge pull request #8705 from amparo-luna/change_update_attributes_to…
…_update

Rename update_attributes method to update

@guilleiguaran guilleiguaran merged commit cb2bd4a into rails:master Jan 3, 2013

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jan 7, 2013

🤘

@davidpiegza

This comment has been minimized.

This renaming causes a conflict when using the association name record in Rails 4. (e.g. belongs_to :record). The method gets overridden by the generated create_#{name} method in https://github.com/rails/rails/blob/4-0-stable/activerecord/lib/active_record/associations/builder/singular_association.rb#L22.

Is this the intended behavior? If yes, it should be documented that it's not allowed to use record as an association name.

/cc @jonleighton

This comment has been minimized.

Copy link
Member

rafaelfranca replied Jul 28, 2013

Please open an issue. Comments on commits are usually ignored.

This comment has been minimized.

Copy link

davidpiegza replied Jul 28, 2013

Sorry! Created issue #11645.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.