Skip to content

Commit

Permalink
pass base object to human_attribute_name in labels
Browse files Browse the repository at this point in the history
  • Loading branch information
motine authored Mar 1, 2023
1 parent 921ce9c commit 1d9890e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/simple_form/components/labels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def label_translation #:nodoc:
if SimpleForm.translate_labels && (translated_label = translate_from_namespace(:labels))
translated_label
elsif object.class.respond_to?(:human_attribute_name)
object.class.human_attribute_name(reflection_or_attribute_name.to_s)
object.class.human_attribute_name(reflection_or_attribute_name.to_s, { base: object })
else
attribute_name.to_s.humanize
end
Expand Down

0 comments on commit 1d9890e

Please sign in to comment.