From b081f6b59fb3f15d12043072ad9b331ffd2bc56e Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Thu, 14 Jun 2012 18:46:38 +0200 Subject: Deprecate 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 deprecated in favor of update_column, and will be removed in Rails 4. See the discussion on rails-core here: https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion --- activerecord/lib/active_record/migration.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record/migration.rb') diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index e6686597b7..b4b4667ce0 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -232,7 +232,7 @@ module ActiveRecord # add_column :people, :salary, :integer # Person.reset_column_information # Person.all.each do |p| - # p.update_attribute :salary, SalaryCalculator.compute(p) + # p.update_column :salary, SalaryCalculator.compute(p) # end # end # end @@ -252,7 +252,7 @@ module ActiveRecord # ... # say_with_time "Updating salaries..." do # Person.all.each do |p| - # p.update_attribute :salary, SalaryCalculator.compute(p) + # p.update_column :salary, SalaryCalculator.compute(p) # end # end # ... -- cgit v1.2.3