Module: ActiveModel::ForbiddenAttributesProtection
Do not use. This module is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
::ActionText::Attachables::ContentAttachment ,
::ActionText::AttachmentGallery ,
API ,
AttributeAssignment ,
Model ,
::ActiveRecord::AssociationRelation ,
::ActiveRecord::Associations::CollectionProxy ,
::ActiveRecord::Base ,
::ActiveRecord::DisableJoinsAssociationRelation ,
::ActiveRecord::QueryMethods ,
::ActiveRecord::Relation
| |
Defined in: | activemodel/lib/active_model/forbidden_attributes_protection.rb |
Instance Method Summary
- #sanitize_for_mass_assignment(attributes) (also: #sanitize_forbidden_attributes) private
-
#sanitize_forbidden_attributes(attributes)
private
Alias for #sanitize_for_mass_assignment.
Instance Method Details
#sanitize_for_mass_assignment(attributes) (private) Also known as: #sanitize_forbidden_attributes
[ GitHub ]# File 'activemodel/lib/active_model/forbidden_attributes_protection.rb', line 23
def sanitize_for_mass_assignment(attributes) if attributes.respond_to?(:permitted?) raise ActiveModel::ForbiddenAttributesError if !attributes.permitted? attributes.to_h else attributes end end
#sanitize_forbidden_attributes(attributes) (private)
Alias for #sanitize_for_mass_assignment.
# File 'activemodel/lib/active_model/forbidden_attributes_protection.rb', line 31
alias :sanitize_forbidden_attributes :sanitize_for_mass_assignment