Created by: edwinwills
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 a User
class, the translated label would be listed under user
and would need to be changed to external_user
.