aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-09-06 21:01:45 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-09-06 21:01:45 -0700
commit41efd73887c00ffd228b05d9346ec47a1f3759b9 (patch)
tree63dc69da5ab66af9770f14dd4ed2cf011c528fdf /activerecord/lib/active_record/base.rb
parent15b1b2b778ce18ff23737b3a0674780d22605fdf (diff)
downloadrails-41efd73887c00ffd228b05d9346ec47a1f3759b9.tar.gz
rails-41efd73887c00ffd228b05d9346ec47a1f3759b9.tar.bz2
rails-41efd73887c00ffd228b05d9346ec47a1f3759b9.zip
Revert "Raise UnknownAttributeError when unknown attributes are supplied via mass assignment"
This reverts commit 108db00aa90fe266564483ab301cf0669cae600f.
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 907495a416..bca2db70f8 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -122,10 +122,6 @@ module ActiveRecord #:nodoc:
class MissingAttributeError < NoMethodError
end
- # Raised when unknown attributes are supplied via mass assignment.
- class UnknownAttributeError < NoMethodError
- end
-
# Raised when an error occurred while doing a mass assignment to an attribute through the
# <tt>attributes=</tt> method. The exception has an +attribute+ property that is the name of the
# offending attribute.
@@ -2441,11 +2437,7 @@ module ActiveRecord #:nodoc:
attributes = remove_attributes_protected_from_mass_assignment(attributes) if guard_protected_attributes
attributes.each do |k, v|
- if k.include?("(")
- multi_parameter_attributes << [ k, v ]
- else
- respond_to?(:"#{k}=") ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}")
- end
+ k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v)
end
assign_multiparameter_attributes(multi_parameter_attributes)