aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-02-26 00:41:01 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-02-26 00:41:01 +0000
commit3d0a9ff437c5e06f8baa6e9a40049411dda8bd0e (patch)
tree0ae8e803f642ccdfbb82dba42b4532194abcfd7f /activerecord
parentff7be746e0cd0ecd67327286f1b2f5ffe96c915f (diff)
downloadrails-3d0a9ff437c5e06f8baa6e9a40049411dda8bd0e.tar.gz
rails-3d0a9ff437c5e06f8baa6e9a40049411dda8bd0e.tar.bz2
rails-3d0a9ff437c5e06f8baa6e9a40049411dda8bd0e.zip
Aesthetics, baby
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index ae15bc0c31..829d4f0a5d 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1348,18 +1348,20 @@ module ActiveRecord #:nodoc:
# from this form of mass-assignment by using the +attr_protected+ macro. Or you can alternatively
# specify which attributes *can* be accessed in with the +attr_accessible+ macro. Then all the
# attributes not included in that won't be allowed to be mass-assigned.
- def attributes=(attrs)
- return if attrs.nil?
- attributes= attrs.dup
+ def attributes=(new_attributes)
+ return if new_attributes.nil?
+ attributes = new_attributes.dup
attributes.stringify_keys!
multi_parameter_attributes = []
remove_attributes_protected_from_mass_assignment(attributes).each do |k, v|
k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v)
end
+
assign_multiparameter_attributes(multi_parameter_attributes)
end
+
# Returns a hash of all the attributes with their names as keys and clones of their objects as values.
def attributes
clone_attributes :read_attribute