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
feat: add missing createRoles association method for HasMany relationship #17163
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR. This would be a nice addition
Don't forget to add the following:
- Typing test
- Integration test
options: | ||
| HasManyCreateAssociationMixinOptions<T> | ||
| HasManyCreateAssociationMixinOptions<T>['fields'] = {}, | ||
): Promise<T[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of copying the code, create
should call createMultiple
@@ -368,6 +368,8 @@ export class BelongsToManyAssociation< | |||
addMultiple: `add${plural}`, | |||
add: `add${singular}`, | |||
create: `create${singular}`, | |||
createMultiple: `create${plural}`, | |||
// TODO: add createMultiple association method for BelongsTo relationship |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: add createMultiple association method for BelongsTo relationship | |
// TODO: add createMultiple association method for BelongsToMany relationship |
Ideally this should be done in the same PR, as it now declares it as being available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to add the HasManyCreateAssociationsMixin
type
Pull Request Checklist
Description of Changes
createMultiple
to create multiple associated instances.Example use case:
this PR closes #11372