diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 8faa5f8a13277ddaab84bf76da5d448e8584fc9c..da380dfbd89aee73b5f7ea33a007e524eace992d 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -41,7 +41,7 @@ def initialize(param) # :nodoc: # permitted.class # => ActionController::Parameters # permitted.permitted? # => true # - # Person.first.update_attributes!(permitted) + # Person.first.update!(permitted) # # => # # # It provides a +permit_all_parameters+ option that controls the top-level @@ -329,7 +329,7 @@ def each_element(object) # # into a 400 Bad Request reply. # def update # redirect_to current_account.people.find(params[:id]).tap { |person| - # person.update_attributes!(person_params) + # person.update!(person_params) # } # end # diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 516492ca30d6bf9c9dbe1742ef3814a98983f104..5fb742157c7f9f71473aee8c2d02dfa46aa0fc32 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -101,9 +101,9 @@ module Helpers # and generate HTML accordingly. # # The controller would receive the form data again in params[:person], ready to be - # passed to Person#update_attributes: + # passed to Person#update: # - # if @person.update_attributes(params[:person]) + # if @person.update(params[:person]) # # success # else # # error handling @@ -897,7 +897,7 @@ def text_area(object_name, method, options = {}) # invoice the user unchecks its check box, no +paid+ parameter is sent. So, # any mass-assignment idiom like # - # @invoice.update_attributes(params[:invoice]) + # @invoice.update(params[:invoice]) # # wouldn't update the flag. # @@ -1569,7 +1569,7 @@ def label(method, text = nil, options = {}, &block) # invoice the user unchecks its check box, no +paid+ parameter is sent. So, # any mass-assignment idiom like # - # @invoice.update_attributes(params[:invoice]) + # @invoice.update(params[:invoice]) # # wouldn't update the flag. # diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 1b5b788a358267bc5f401fa72b2d58e92fb6d9e6..bcad05e033598c882e49cca9f5b16fb5f19e234b 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -130,7 +130,7 @@ module FormOptionsHelper # the user deselects all roles from +role_ids+ multiple select box, no +role_ids+ parameter is sent. So, # any mass-assignment idiom like # - # @user.update_attributes(params[:user]) + # @user.update(params[:user]) # # wouldn't update roles. # diff --git a/actionpack/lib/action_view/record_identifier.rb b/actionpack/lib/action_view/record_identifier.rb index 29536549721e0f67982e4dbd1a327c90953fc138..63f645431a68161432e04889ead4398cc3133989 100644 --- a/actionpack/lib/action_view/record_identifier.rb +++ b/actionpack/lib/action_view/record_identifier.rb @@ -17,7 +17,7 @@ module ActionView # # controller # def update # post = Post.find(params[:id]) - # post.update_attributes(params[:post]) + # post.update(params[:post]) # # redirect_to(post) # Calls polymorphic_url(post) which in turn calls post_url(post) # end diff --git a/activerecord/examples/performance.rb b/activerecord/examples/performance.rb index cd9825b50c8a426b0e19ab9e8c86c88edf7aa95b..ad12f8597f10d94227f33649dd8431f82d6fcc1b 100644 --- a/activerecord/examples/performance.rb +++ b/activerecord/examples/performance.rb @@ -143,7 +143,7 @@ def self.email end x.report 'Resource#update' do - Exhibit.first.update_attributes(:name => 'bob') + Exhibit.first.update(name: 'bob') end x.report 'Resource#destroy' do diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb index 4c9bd76d7ce33801e23f4f96a753b2c089e4c9a3..c5bd11edbf91da583ca35dc79488297c7993a2de 100644 --- a/activerecord/lib/active_record/nested_attributes.rb +++ b/activerecord/lib/active_record/nested_attributes.rb @@ -58,7 +58,7 @@ class TooManyRecords < ActiveRecordError # It also allows you to update the avatar through the member: # # params = { member: { avatar_attributes: { id: '2', icon: 'sad' } } } - # member.update_attributes params[:member] + # member.update params[:member] # member.avatar.icon # => 'sad' # # By default you will only be able to set and update attributes on the diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 287c42a481af58f2c2e6fe67e3d25214c67e3b3f..3011f959a5a0f682b22f0c65098d6bbfa5142d76 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -223,7 +223,7 @@ def update(attributes) alias update_attributes update - # Updates its receiver just like +update_attributes+ but calls save! instead + # Updates its receiver just like +update+ but calls save! instead # of +save+, so an exception is raised if the record is invalid. def update!(attributes) # The following transaction covers any possible database side-effects of the diff --git a/activesupport/lib/active_support/core_ext/hash/except.rb b/activesupport/lib/active_support/core_ext/hash/except.rb index 5cb00d0ebd8c13d12347504facee02c66d9685c2..d90e996ad4800bc065b6d9c97caac1a8859151e8 100644 --- a/activesupport/lib/active_support/core_ext/hash/except.rb +++ b/activesupport/lib/active_support/core_ext/hash/except.rb @@ -2,7 +2,7 @@ class Hash # Return a hash that includes everything but the given keys. This is useful for # limiting a set of parameters to everything but a few known toggles: # - # @person.update_attributes(params[:person].except(:admin)) + # @person.update(params[:person].except(:admin)) def except(*keys) dup.except!(*keys) end