Module: ActiveModel::ForbiddenAttributesProtection

Defined in:
lib/active_model/forbidden_attributes_protection.rb

Instance Method Summary collapse

Instance Method Details

#sanitize_for_mass_assignment(new_attributes, options = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/active_model/forbidden_attributes_protection.rb', line 6

def sanitize_for_mass_assignment(new_attributes, options = {})
  if !new_attributes.respond_to?(:permitted?) || (new_attributes.respond_to?(:permitted?) && new_attributes.permitted?)
    super
  else
    raise ActiveModel::ForbiddenAttributes
  end
end