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 {ActiveRecord::Base#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 = nil, exception = nil, attribute = nil) ⇒ AttributeAssignmentError

[ GitHub ]

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

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

Instance Attribute Details

#attribute (readonly)

[ GitHub ]

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

attr_reader :exception, :attribute

#exception (readonly)

[ GitHub ]

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

attr_reader :exception, :attribute