method

compute_attribute

rails latest stable - Class: ActiveRecord::Associations::NestedError

Method not available on this version

This method is only available on newer versions. The first available version (v7.2.3) is shown here.

compute_attribute(inner_error)
private

No documentation available.

# File activerecord/lib/active_record/associations/nested_error.rb, line 18
        def compute_attribute(inner_error)
          association_name = association.reflection.name

          if association.collection? && index_errors_setting && index
            "#{association_name}[#{index}].#{inner_error.attribute}".to_sym
          else
            "#{association_name}.#{inner_error.attribute}".to_sym
          end
        end