Class: ActiveModel::MassAssignmentSecurity::LoggerSanitizer
- Defined in:
- lib/active_model/mass_assignment_security/sanitizer.rb
Instance Method Summary collapse
-
#initialize(target) ⇒ LoggerSanitizer
constructor
A new instance of LoggerSanitizer.
- #logger? ⇒ Boolean
- #process_removed_attributes(attrs) ⇒ Object
Methods inherited from Sanitizer
Constructor Details
#initialize(target) ⇒ LoggerSanitizer
Returns a new instance of LoggerSanitizer.
31 32 33 34 |
# File 'lib/active_model/mass_assignment_security/sanitizer.rb', line 31 def initialize(target) @target = target super end |
Instance Method Details
#logger? ⇒ Boolean
36 37 38 |
# File 'lib/active_model/mass_assignment_security/sanitizer.rb', line 36 def logger? @target.respond_to?(:logger) && @target.logger end |
#process_removed_attributes(attrs) ⇒ Object
40 41 42 |
# File 'lib/active_model/mass_assignment_security/sanitizer.rb', line 40 def process_removed_attributes(attrs) logger.debug "WARNING: Can't mass-assign protected attributes: #{attrs.join(', ')}" if logger? end |