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

Fix support for defining custom relations #95

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Conversation

laxity7
Copy link
Contributor

@laxity7 laxity7 commented Jan 8, 2025

What was changed: The order of array merging in the RelationConfig was adjusted to give custom relations higher priority over default settings.

Previously:

Copy code
$relationConfig = new RelationConfig(
    RelationConfig::getDefault()->toArray() + $config->getCustomRelations()
);

Now:

Copy code
$relationConfig = new RelationConfig(
    $config->getCustomRelations() + RelationConfig::getDefault()->toArray()
);

Why this change was made: The current implementation does not allow customRelations to override default settings. By changing the merge order, custom relations now take precedence, enabling users to redefine default settings when necessary. This improves flexibility and allows for more tailored configurations.

@roxblnfk roxblnfk merged commit 024fa0f into spiral:2.x Jan 8, 2025
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.

2 participants