Class: ActiveModel::MassAssignmentSecurity::Sanitizer
- Inherits:
-
Object
- Object
- ActiveModel::MassAssignmentSecurity::Sanitizer
- Defined in:
- lib/active_model/mass_assignment_security/sanitizer.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
-
#sanitize(klass, attributes, authorizer) ⇒ Object
Returns all attributes not denied by the authorizer.
Instance Method Details
#sanitize(klass, attributes, authorizer) ⇒ Object
Returns all attributes not denied by the authorizer.
5 6 7 8 9 10 11 12 |
# File 'lib/active_model/mass_assignment_security/sanitizer.rb', line 5 def sanitize(klass, attributes, ) rejected = [] sanitized_attributes = attributes.reject do |key, value| rejected << key if .deny?(key) end process_removed_attributes(klass, rejected) unless rejected.empty? sanitized_attributes end |