We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a36c36 commit 1c26a39Copy full SHA for 1c26a39
activerecord/lib/active_record/associations/nested_error.rb
@@ -18,15 +18,11 @@ def initialize(association, inner_error)
18
def compute_attribute(inner_error)
19
association_name = association.reflection.name
20
21
- attribute =
22
- if index_errors_setting && index
23
- "#{association_name}[#{index}]"
24
- else
25
- association_name
26
- end
27
-
28
- attribute = :"#{attribute}.#{inner_error.attribute}" if inner_error.attribute != :base
29
- attribute.to_sym
+ if index_errors_setting && index
+ "#{association_name}[#{index}].#{inner_error.attribute}".to_sym
+ else
+ "#{association_name}.#{inner_error.attribute}".to_sym
+ end
30
end
31
32
def index_errors_setting
0 commit comments