Class Index [+]

Quicksearch

ActiveModel::MassAssignmentSecurity::Sanitizer

Public Instance Methods

sanitize(attributes) click to toggle source

Returns all attributes not denied by the authorizer.

   # File lib/active_model/mass_assignment_security/sanitizer.rb, line 5
5:       def sanitize(attributes)
6:         sanitized_attributes = attributes.reject { |key, value| deny?(key) }
7:         debug_protected_attribute_removal(attributes, sanitized_attributes)
8:         sanitized_attributes
9:       end

Protected Instance Methods

debug_protected_attribute_removal(attributes, sanitized_attributes) click to toggle source
    # File lib/active_model/mass_assignment_security/sanitizer.rb, line 13
13:       def debug_protected_attribute_removal(attributes, sanitized_attributes)
14:         removed_keys = attributes.keys - sanitized_attributes.keys
15:         warn!(removed_keys) if removed_keys.any?
16:       end
warn!(attrs) click to toggle source
    # File lib/active_model/mass_assignment_security/sanitizer.rb, line 18
18:       def warn!(attrs)
19:         self.logger.debug "WARNING: Can't mass-assign protected attributes: #{attrs.join(', ')}" if self.logger
20:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.