Exception: ActiveRecord::AttributeAssignmentError

Inherits:
ActiveRecordError show all
Defined in:
lib/active_record/base.rb

Overview

Raised when an error occured 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

Returns a new instance of AttributeAssignmentError.



105
106
107
108
109
# File 'lib/active_record/base.rb', line 105

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

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



104
105
106
# File 'lib/active_record/base.rb', line 104

def attribute
  @attribute
end

#exceptionObject (readonly)

Returns the value of attribute exception.



104
105
106
# File 'lib/active_record/base.rb', line 104

def exception
  @exception
end