Module: MongoModel::AttributeMethods::Protected

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::MassAssignmentSecurity
Included in:
EmbeddedDocument
Defined in:
lib/mongomodel/concerns/attribute_methods/protected.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#assign_attributes(attrs, options = {}) ⇒ Object


19
20
21
22
23
24
25
# File 'lib/mongomodel/concerns/attribute_methods/protected.rb', line 19

def assign_attributes(attrs, options={})
  if options[:without_protection]
    super
  else
    super(sanitize_for_mass_assignment(attrs, options[:as] || :default))
  end
end