From ffb9db0247084514adc73ae92dfe8d5a3033226b Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 10 May 2014 13:44:43 +0000 Subject: copy edits [ci skip] --- activerecord/lib/active_record/attribute_assignment.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/active_record/attribute_assignment.rb') diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb index 5007e319da..87ecbe54f1 100644 --- a/activerecord/lib/active_record/attribute_assignment.rb +++ b/activerecord/lib/active_record/attribute_assignment.rb @@ -12,15 +12,14 @@ module ActiveRecord # of this method is +false+ an ActiveModel::ForbiddenAttributesError # exception is raised. # - # Example: - # # cat = Cat.new(name: "Gorby", status: "yawning") - # cat.attributes # => {"name" => "Gorby", "status" => "yawning"} + # cat.attributes # => { "name" => "Gorby", "status" => "yawning" } # cat.assign_attributes(status: "sleeping") - # cat.attributes # => {"name" => "Gorby", "status" => "sleeping"} + # cat.attributes # => { "name" => "Gorby", "status" => "sleeping" } + # + # New attributes will be persisted in the database when the object is saved. # - # New attributes will be persisted to database when object is saved. - # attributes = is an alias. + # Aliased to attributes=. def assign_attributes(new_attributes) if !new_attributes.respond_to?(:stringify_keys) raise ArgumentError, "When assigning attributes, you must pass a hash as an argument." -- cgit v1.2.3