Class: Mongoid::MultiParameterAttributes::Errors::AttributeAssignmentError

Inherits:
Errors::MongoidError
  • Object
show all
Defined in:
lib/mongoid_multiparams.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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, exception, attribute) ⇒ AttributeAssignmentError



47
48
49
50
51
# File 'lib/mongoid_multiparams.rb', line 47

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

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



45
46
47
# File 'lib/mongoid_multiparams.rb', line 45

def attribute
  @attribute
end

#exceptionObject (readonly)

Returns the value of attribute exception.



45
46
47
# File 'lib/mongoid_multiparams.rb', line 45

def exception
  @exception
end