aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-11-09 19:57:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-11-09 19:57:24 +0000
commitb318134c99dc3f0f639f6dd225bfc807b4e76460 (patch)
treebc29e9329aee0fb65b077811d30ee1150f556b58 /activerecord/lib/active_record/base.rb
parent21350d226e525a70a29076b65455193a0255a5c3 (diff)
downloadrails-b318134c99dc3f0f639f6dd225bfc807b4e76460.tar.gz
rails-b318134c99dc3f0f639f6dd225bfc807b4e76460.tar.bz2
rails-b318134c99dc3f0f639f6dd225bfc807b4e76460.zip
Kill the whiny_protected_attributes setting and kill the exception raised. Instead, just log the mass-assignment misalignment as a debug warning (closes #9966)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8120 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 3e7fa13e97..991d8b040c 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -35,8 +35,6 @@ module ActiveRecord #:nodoc:
end
class Rollback < ActiveRecordError #:nodoc:
end
- class ProtectedAttributeAssignmentError < ActiveRecordError #:nodoc:
- end
class DangerousAttributeError < ActiveRecordError #:nodoc:
end
@@ -359,11 +357,6 @@ module ActiveRecord #:nodoc:
cattr_accessor :schema_format , :instance_writer => false
@@schema_format = :ruby
- # Determines whether to raise an exception on mass-assignment to protected
- # attributes. Defaults to true.
- cattr_accessor :whiny_protected_attributes, :instance_writer => false
- @@whiny_protected_attributes = true
-
class << self # Class methods
# Find operates with three different retrieval approaches:
#
@@ -2101,12 +2094,7 @@ module ActiveRecord #:nodoc:
removed_attributes = attributes.keys - safe_attributes.keys
if removed_attributes.any?
- error_message = "Can't mass-assign these protected attributes: #{removed_attributes.join(', ')}"
- if self.class.whiny_protected_attributes
- raise ProtectedAttributeAssignmentError, error_message
- else
- logger.error error_message
- end
+ logger.debug "WARNING: Can't mass-assign these protected attributes: #{removed_attributes.join(', ')}"
end
safe_attributes