public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
move logging of protected attribute removal into log_protected_attribute_removal 
method

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#804 status:committed]
trevorturk (author)
Mon Aug 11 19:17:14 -0700 2008
NZKoz (committer)
Tue Aug 12 00:52:06 -0700 2008
commit  81c12d1f6359eb5e52b376f1f3552097a144cc8b
tree    fb59cc6d80e944b443a9564ab9fccc62ce018113
parent  c7375d74d9fff3219d4ea389ba9e36a90afe9d33
...
2594
2595
2596
2597
 
2598
2599
2600
...
2609
2610
2611
 
 
 
 
2612
2613
2614
...
2594
2595
2596
 
2597
2598
2599
2600
...
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
0
@@ -2594,7 +2594,7 @@ module ActiveRecord #:nodoc:
0
         removed_attributes = attributes.keys - safe_attributes.keys
0
 
0
         if removed_attributes.any?
0
-          logger.debug "WARNING: Can't mass-assign these protected attributes: #{removed_attributes.join(', ')}"
0
+          log_protected_attribute_removal(removed_attributes)
0
         end
0
 
0
         safe_attributes
0
@@ -2609,6 +2609,10 @@ module ActiveRecord #:nodoc:
0
         end
0
       end
0
 
0
+      def log_protected_attribute_removal(*attributes)
0
+        logger.debug "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
0
+      end
0
+
0
       # The primary key and inheritance column can never be set by mass-assignment for security reasons.
0
       def attributes_protected_by_default
0
         default = [ self.class.primary_key, self.class.inheritance_column ]

Comments