Exception: Mongoid::MultiParameterAttributes::Errors::AttributeAssignmentError

Inherits:
Errors::MongoidError show all
Defined in:
lib/mongoid/multi_parameter_attributes.rb

Overview

Raised when an error occurred while doing a mass assignment to an attribute through the attributes= method. The exception has an attribute property that is the name of the offending attribute.

Constant Summary

Constants inherited from Errors::MongoidError

Errors::MongoidError::BASE_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Errors::MongoidError

#translate

Constructor Details

#initialize(message, exception, attribute) ⇒ AttributeAssignmentError

Returns a new instance of AttributeAssignmentError.



12
13
14
15
16
# File 'lib/mongoid/multi_parameter_attributes.rb', line 12

def initialize(message, exception, attribute)
  @exception = exception
  @attribute = attribute
  @message = message
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



11
12
13
# File 'lib/mongoid/multi_parameter_attributes.rb', line 11

def attribute
  @attribute
end

#exceptionObject (readonly)

Returns the value of attribute exception.



11
12
13
# File 'lib/mongoid/multi_parameter_attributes.rb', line 11

def exception
  @exception
end