-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove the include
option from Model.create
#15233
Labels
good first issue
For issues. An issue that is a good choice for first-time contributors.
type: feature
For issues and PRs. For new features. Never breaking changes.
Comments
ephys
added
the
type: feature
For issues and PRs. For new features. Never breaking changes.
label
Nov 4, 2022
2 tasks
6 tasks
ephys
added
the
good first issue
For issues. An issue that is a good choice for first-time contributors.
label
Jan 25, 2023
5 tasks
Hi, I would like to work on the issue. Please specify if this is still open? |
It is, we try to keep our issues up-to-date as much as possible |
hello is it still open i would love to work on this |
Yes, this is still open |
6 tasks
Quickly checking if this is stuck. I see some pending changes were requested about a month ago in #16922 . Just in case I can assist in any way. Very grateful for the work of everyone 🙏 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
For issues. An issue that is a good choice for first-time contributors.
type: feature
For issues and PRs. For new features. Never breaking changes.
Feature Description
The
include
option inModel.create
is counter-intuitive. I've seen many help requests (most recent: #14759) where the user expectsinclude
to select the association after the model has been created. In reality, it's used to create associated objects.Currently, this only creates a player, not a team:
While this creates a player & a team and associates the team and the player
The thing is,
Player
already knowsteam
is an association (associations & attributes cannot share the same name). The first example could already work, we don't need the second version.I propose to remove the
include
option altogether.Similarly, you should be able to do use the association field to link an association that already exists:
Or that has been built but not persisted yet:
Is this feature dialect-specific?
Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: