aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-06-28 17:15:01 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-06-28 17:15:01 +0000
commitc92ecb82b816df530b43f7334e1ad80beeac3f4c (patch)
tree662d838f07953d194608cf2052cbbbaecaf5ea4f /activerecord/lib/active_record
parentd763f08ba81f0e3e4aac9c09f0342a2a53254211 (diff)
downloadrails-c92ecb82b816df530b43f7334e1ad80beeac3f4c.tar.gz
rails-c92ecb82b816df530b43f7334e1ad80beeac3f4c.tar.bz2
rails-c92ecb82b816df530b43f7334e1ad80beeac3f4c.zip
Fixed that multiparameter posts ignored attr_protected #1532 [alec+rails@veryclever.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1550 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 7e2acb5acf..0060f694a2 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1279,11 +1279,11 @@ module ActiveRecord #:nodoc:
def remove_attributes_protected_from_mass_assignment(attributes)
if self.class.accessible_attributes.nil? && self.class.protected_attributes.nil?
- attributes.reject { |key, value| attributes_protected_by_default.include?(key) }
+ attributes.reject { |key, value| attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
elsif self.class.protected_attributes.nil?
- attributes.reject { |key, value| !self.class.accessible_attributes.include?(key.intern) || attributes_protected_by_default.include?(key) }
+ attributes.reject { |key, value| !self.class.accessible_attributes.include?(key.gsub(/\(.+/, "").intern) || attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
elsif self.class.accessible_attributes.nil?
- attributes.reject { |key, value| self.class.protected_attributes.include?(key.intern) || attributes_protected_by_default.include?(key) }
+ attributes.reject { |key, value| self.class.protected_attributes.include?(key.gsub(/\(.+/,"").intern) || attributes_protected_by_default.include?(key.gsub(/\(.+/, "")) }
end
end