Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix: '<attribute>' and '<attribute>_id' conflict. #1709

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CodeMeister
Copy link

@CodeMeister CodeMeister commented Oct 28, 2024

Fixes: #1680
Fixes: #1142

Addresses: #1708

When a factory has both <attribute> and <attribute>_id, each one is considered an alias for the other
and are not assigned correctly.

This request eliminates this issue by checking if the override is an existing attribute name, before matching against an alias.

  • AttributeAssigner refactored to ignore a matching attribute alias, if it also matches the name of another attribute.
  • Renamed two methods to give more clarity to their purpose.
  • Tests added for attribute assignment.

It works for any recorded aliases, not just '_id'.

  - AttributeAssigner refactored to ignore a
    matching attribute alias, if it also
    matches the name of another attribute.

  - Tests added for attribute assignment.
@CodeMeister CodeMeister changed the title Fixes '<attribute>' and '<attribute>_id' conflict. BugFix: '<attribute>' and '<attribute>_id' conflict. Nov 5, 2024
@unused
Copy link

unused commented Nov 10, 2024

I had expected this problem to be much more difficult to resolve, but can't find anything wrong with your code, good job 🙌 When trying to understand the conflict ignored attributes - that as far as I've seen only applies to transient ones - makes the processing hard to understand. I think you managed well to make this easier to grasp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not overwrite the dafault value Confusion around aliases for {attribute} and {attribute}_id
2 participants