123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Associations::NestedError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveModel::NestedError
Defined in: activerecord/lib/active_record/associations/nested_error.rb

Constant Summary

::ActiveModel::Error - Inherited

CALLBACKS_OPTIONS, MESSAGE_OPTIONS

Class Attribute Summary

Class Method Summary

Instance Attribute Summary

::ActiveModel::NestedError - Inherited

::ActiveModel::Error - Inherited

#attribute

The attribute of base which the error belongs to.

#base

The object which the error belongs to.

#i18n_customize_full_message, #i18n_customize_full_message?,
#options

The options provided when calling errors#add.

#raw_type

The raw value provided as the second parameter when calling errors#add.

#type

The type of error, defaults to :invalid unless specified.

Instance Method Summary

::ActiveModel::Error - Inherited

#detail
#details

Returns the error details.

#eql?
#full_message

Returns the full error message.

#match?

See if error matches provided attribute, type, and options.

#message

Returns the error message.

#strict_match?

See if error matches provided attribute, type, and options exactly.

Constructor Details

.new(association, inner_error) ⇒ NestedError

[ GitHub ]

  
# File 'activerecord/lib/active_record/associations/nested_error.rb', line 8

def initialize(association, inner_error)
  @base = association.owner
  @association = association
  @inner_error = inner_error
  super(@base, inner_error, { attribute: compute_attribute(inner_error) })
end