Use field.name
rather than field.nested_form.resource_name
for Field::HasOne
labels
#2164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a model has multiple has_one relationships to the same model (e.g. two has_one associations with different scopes), we can't override the field label for the two associations, we can only change the translation for both at the same time, as the translation is based on the associated class name, not the association name.
This change uses the association name as the lookup field and default value for the label for has_one relationships, allowing multiple relations to the same class to have their own translated labels.
This is a potential breaking change for apps that have set a translation label based on the class name, but have a custom-named association (e.g. if a model has the association
:external_user
pointing to aUser
class, the translated label would be listed underuser
and would need to be changed toexternal_user
.