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

Bug: Scope with function is not added correctly #70

Closed
kingjerod opened this issue Jul 25, 2017 · 1 comment
Closed

Bug: Scope with function is not added correctly #70

kingjerod opened this issue Jul 25, 2017 · 1 comment
Assignees
Labels

Comments

@kingjerod
Copy link
Contributor

If you have a scope with a function like so:

@Scopes({
  something: function (id) {
    return {
      where: {id: id}
    }
  }
})

It doesn't get added properly to the Sequelize model. I was ready to open a PR to fix this, but I think it's beyond my knowledge of this module. The problem is in resolveScope in the lib/services/model file, it should check if the options is a function and if so, just add the scope. I'm not sure if there is something else that needs to be done to the function.

@RobinBuschmann
Copy link
Member

@kingjerod Thanks for contributing. I've investigated this one and... yes, you're right, this is a bug.

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

No branches or pull requests

2 participants