Exception: ActiveRecord::AttributeAssignmentError

Inherits:
ActiveRecordError show all
Defined in:
activerecord/lib/active_record/errors.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

Returns a new instance of AttributeAssignmentError.



186
187
188
189
190
# File 'activerecord/lib/active_record/errors.rb', line 186

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

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute



185
186
187
# File 'activerecord/lib/active_record/errors.rb', line 185

def attribute
  @attribute
end

#exceptionObject (readonly)

Returns the value of attribute exception



185
186
187
# File 'activerecord/lib/active_record/errors.rb', line 185

def exception
  @exception
end