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

Be more precise with unscope-ing #263

Closed
brendon opened this issue Mar 29, 2017 · 3 comments
Closed

Be more precise with unscope-ing #263

brendon opened this issue Mar 29, 2017 · 3 comments
Assignees

Comments

@brendon
Copy link
Owner

brendon commented Mar 29, 2017

Hi @fabn, I was wondering if you could travel back in time and give a bit more detail as to your intention with this commit?:

4a45dca

I've been having deadlock issues around the :order scope being cleared in aal updates (e.g. shuffling the table) vs other updates where the default_scope is kept intact.

What do you think about just calling: .unscope(:where) instead? Are there other scope types we'd need to unscope? I don't think there is as we really only want to make sure that our .where clauses are the only ones in there.

What do you think @swanandp?

@fabn
Copy link
Contributor

fabn commented Mar 29, 2017

Hi @brendon, I think you are right, .unscope(:where) should be enough, but it will mean to drop compatibility with rails 3 since that method is only available with rails >= 4.0.

Maybe except could help to preserve rails 3 compatibility.

@swanandp
Copy link
Contributor

I will get to this shortly.

@brendon
Copy link
Owner Author

brendon commented Mar 30, 2017

I've had good success with this PR. Let's see how the CI runs for all scenarios. I had to .reorder instead of .order but again, that's less of a blunt instrument.

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

No branches or pull requests

3 participants