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

- (AttributeAssignmentError) initialize(message, exception, attribute)



156
157
158
159
160
# File 'activerecord/lib/active_record/errors.rb', line 156

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

Instance Attribute Details

- (Object) attribute (readonly)

Returns the value of attribute attribute



155
156
157
# File 'activerecord/lib/active_record/errors.rb', line 155

def attribute
  @attribute
end

- (Object) exception (readonly)

Returns the value of attribute exception



155
156
157
# File 'activerecord/lib/active_record/errors.rb', line 155

def exception
  @exception
end