Method: ActiveModel::ForbiddenAttributesProtection#sanitize_for_mass_assignment

Defined in:
lib/active_model/forbidden_attributes_protection.rb

#sanitize_for_mass_assignment(*options) ⇒ Object



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

def sanitize_for_mass_assignment(*options)
  new_attributes = options.first
  if !new_attributes.respond_to?(:permitted?) || new_attributes.permitted?
    super
  else
    raise ActiveModel::ForbiddenAttributes
  end
end