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

Adding missing createRoles association method for HasMany relationship #11372

Open
2 of 6 tasks
w-etc opened this issue Aug 30, 2019 · 4 comments · May be fixed by #17163
Open
2 of 6 tasks

Adding missing createRoles association method for HasMany relationship #11372

w-etc opened this issue Aug 30, 2019 · 4 comments · May be fixed by #17163
Labels
good first issue For issues. An issue that is a good choice for first-time contributors. status: understood For issues. Applied when the issue is understood / reproducible. type: feature For issues and PRs. For new features. Never breaking changes.

Comments

@w-etc
Copy link

w-etc commented Aug 30, 2019

Issue Description

Is your feature request related to a problem? Please describe.

I have a OneToMany relationship between a Post and Comments. I noticed that this relationship provides me with the following methods:

     *    // getRoles...
     *    // setRoles...
     *    // addRoles...
     *    // addRole...
     *    // createRole...
     *    // removeRole...
     *    // removeRoles...
     *    // hasRole...
     *    // hasRoles...
     *    // countRoles...

In a particular use case that I have, I also need a createRoles method, which is not provided.

Describe the solution you'd like

I'd like the hasMany relationship to generate this method for me along with the other ones.

Why should this be in Sequelize

I think this is a valid use case. Just as we are able to addRoles and removeRoles, it makes sense to me that we should be able to createRoles too.

Issue Template Checklist

Is this issue dialect-specific?

  • No. This issue is relevant to Sequelize as a whole.
  • Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
@papb
Copy link
Member

papb commented Aug 30, 2019

I agree. Thanks for the request.

@papb papb added good first issue For issues. An issue that is a good choice for first-time contributors. status: understood For issues. Applied when the issue is understood / reproducible. type: feature For issues and PRs. For new features. Never breaking changes. labels Aug 30, 2019
@eliasreis54
Copy link

i'd ilke to try put this function. Do i need to assign some place?

@papb
Copy link
Member

papb commented Oct 9, 2019

Hi @eliasreis54, sorry to take long to reply. You could have just started to work on a PR; however someone else already did it 😅

Regardless, thank you for the interest! Hopefully you'll help us in the future.

EDIT: Wait, I think this is only partially implemented

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2021

This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

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. status: understood For issues. Applied when the issue is understood / reproducible. type: feature For issues and PRs. For new features. Never breaking changes.
Projects
None yet
4 participants