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

Fails to acknowledge scope #46

Closed
dsmackie opened this issue Apr 4, 2019 · 2 comments
Closed

Fails to acknowledge scope #46

dsmackie opened this issue Apr 4, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@dsmackie
Copy link
Contributor

dsmackie commented Apr 4, 2019

Pagination is forced to the default model. Any attempt to scope prior to pagination is ignored.

See PR #45

@lgaticaq
Copy link
Member

lgaticaq commented Apr 5, 2019

Hi. Can you indicate an example where an error occurs with what you indicate please

@lgaticaq lgaticaq self-assigned this Apr 5, 2019
@lgaticaq lgaticaq added the bug Something isn't working label Apr 5, 2019
@dsmackie
Copy link
Contributor Author

dsmackie commented Apr 7, 2019

models.User.addScope('deleted', {
  where: {
    delete: true
  }
}

let result = models.User.scope('deleted').paginate();

The result will contain all users as the paginate function ignores the assigned scope since it is called on the parent model instead of the scoped instance.

lgaticaq pushed a commit that referenced this issue Apr 10, 2019
## [1.1.6](v1.1.5...v1.1.6) (2019-04-10)

### Bug Fixes

* allow for inclusion of scope by [@dsmackie](https://github.com/dsmackie) ([5861f9f](5861f9f)), closes [#46](#46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants