123456789_123456789_123456789_123456789_123456789_

Exception: ActiveRecord::AttributeAssignmentError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ActiveRecordError, StandardError
Instance Chain:
self, ActiveRecordError, StandardError
Inherits: ActiveRecord::ActiveRecordError
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.

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(message, exception, attribute) ⇒ AttributeAssignmentError

[ GitHub ]

  
# File 'activerecord/lib/active_record/errors.rb', line 200

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

Instance Attribute Details

#attribute (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/errors.rb', line 198

attr_reader :exception, :attribute

#exception (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/errors.rb', line 198

attr_reader :exception, :attribute