aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorTrevor Turk <trevorturk@yahoo.com>2008-08-11 21:17:14 -0500
committerMichael Koziarski <michael@koziarski.com>2008-08-12 09:52:06 +0200
commit81c12d1f6359eb5e52b376f1f3552097a144cc8b (patch)
treefb59cc6d80e944b443a9564ab9fccc62ce018113 /activerecord
parentc7375d74d9fff3219d4ea389ba9e36a90afe9d33 (diff)
downloadrails-81c12d1f6359eb5e52b376f1f3552097a144cc8b.tar.gz
rails-81c12d1f6359eb5e52b376f1f3552097a144cc8b.tar.bz2
rails-81c12d1f6359eb5e52b376f1f3552097a144cc8b.zip
move logging of protected attribute removal into log_protected_attribute_removal method
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#804 status:committed]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/base.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 29c2995334..e5b6e3a02f 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2594,7 +2594,7 @@ module ActiveRecord #:nodoc:
removed_attributes = attributes.keys - safe_attributes.keys
if removed_attributes.any?
- logger.debug "WARNING: Can't mass-assign these protected attributes: #{removed_attributes.join(', ')}"
+ log_protected_attribute_removal(removed_attributes)
end
safe_attributes
@@ -2609,6 +2609,10 @@ module ActiveRecord #:nodoc:
end
end
+ def log_protected_attribute_removal(*attributes)
+ logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
+ end
+
# The primary key and inheritance column can never be set by mass-assignment for security reasons.
def attributes_protected_by_default
default = [ self.class.primary_key, self.class.inheritance_column ]