Class: ActiveRecord::Associations::NestedError
- Inherits:
-
ActiveModel::NestedError
- Object
- ActiveModel::Error
- ActiveModel::NestedError
- ActiveRecord::Associations::NestedError
- Defined in:
- activerecord/lib/active_record/associations/nested_error.rb
Constant Summary
Constants inherited from ActiveModel::Error
ActiveModel::Error::CALLBACKS_OPTIONS, ActiveModel::Error::MESSAGE_OPTIONS
Instance Attribute Summary
Attributes inherited from ActiveModel::NestedError
Attributes inherited from ActiveModel::Error
#attribute, #base, #options, #raw_type, #type
Instance Method Summary collapse
-
#initialize(association, inner_error) ⇒ NestedError
constructor
A new instance of NestedError.
Methods inherited from ActiveModel::Error
#==, #details, #full_message, full_message, generate_message, #hash, #initialize_dup, #inspect, #match?, #message, #strict_match?
Constructor Details
#initialize(association, inner_error) ⇒ NestedError
Returns a new instance of NestedError.
8 9 10 11 12 13 |
# 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 |