Module: MongoModel::AttributeMethods::Forbidden

Extended by:
ActiveSupport::Concern
Included in:
EmbeddedDocument
Defined in:
lib/mongomodel/concerns/attribute_methods/forbidden.rb

Instance Method Summary collapse

Instance Method Details

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


8
9
10
11
12
13
14
# File 'lib/mongomodel/concerns/attribute_methods/forbidden.rb', line 8

def assign_attributes(attrs, options={})
  if attrs.respond_to?(:permitted?) && !attrs.permitted?
    raise ActiveModel::ForbiddenAttributesError
  else
    super
  end
end