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

loading a parent scope should trigger client side scoping of children #82

Closed
catmando opened this issue Dec 7, 2018 · 1 comment
Closed
Labels
bug Something isn't working ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch
Milestone

Comments

@catmando
Copy link
Contributor

catmando commented Dec 7, 2018

related to #78.

For example:

# assume the active scope has a client side filter method

Todo.all.active.count # request just the count but not the whole scope
Todo.all.each ...  # fetch the parent scope
... # later after parent scope has finished loading
Todo.all.active.each ... # this unnecessarily loads active from server

The problem all.active collection is created first, and linked to all (the parent)
but parent does not have loaded collection yet, so we skip filtering.

perhaps calling sync_collection_with_parent in the all method could fix it easily?

@catmando catmando added this to the alpha1.3 milestone Dec 7, 2018
@catmando catmando added the bug Something isn't working label Dec 7, 2018
@catmando
Copy link
Contributor Author

closed. see batch4/scope_spec.rb: 347

@catmando catmando added the ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch label Jan 15, 2019
mpantel pushed a commit to mpantel/hyperstack that referenced this issue Jul 10, 2023
mpantel pushed a commit to mpantel/hyperstack that referenced this issue Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-release Internal Use Only: Has been fixed, specs passing and pushed to edge branch
Projects
None yet
Development

No branches or pull requests

1 participant