Module: ActiveModel::MassAssignmentSecurity::Sanitizer

Included in:
BlackList, WhiteList
Defined in:
activemodel/lib/active_model/mass_assignment_security/sanitizer.rb

Instance Method Summary collapse

Instance Method Details

#sanitize(attributes) ⇒ Object

Returns all attributes not denied by the authorizer.



5
6
7
8
9
# File 'activemodel/lib/active_model/mass_assignment_security/sanitizer.rb', line 5

def sanitize(attributes)
  sanitized_attributes = attributes.reject { |key, value| deny?(key) }
  debug_protected_attribute_removal(attributes, sanitized_attributes)
  sanitized_attributes
end