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

Feature/allow separate and parameters & Fix Relation with Or #49

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

lloy0076
Copy link

There are no tests for this (but it does work) and this PR is more for discussion.

This address issue #42 by allowing users to append __and and __or; all the __and will group together and the __ors are self explanatory. So you can do:

  • url?columnOne__and=1&columnTwo__and&columnThree__or

It also fixes #38 which is a duplicate of PR #39 but I'm not sure #39 works.

1. First, we must remove all filtered query parameter
2. Check each query parameter for the special flage `.*__and` or `.*__or`
3. If that exists group in the `where` or `orWhere` clause respectively

This seems to actually work.
(Fix unused variable)

1. First, we must remove all filtered query parameter
2. Check each query parameter for the special flage `.*__and` or `.*__or`
3. If that exists group in the `where` or `orWhere` clause respectively

This seems to actually work.
(Always group them!)

1. First, we must remove all filtered query parameter
2. Check each query parameter for the special flage `.*__and` or `.*__or`
3. If that exists group in the `where` or `orWhere` clause respectively

This seems to actually work.
@lloy0076
Copy link
Author

Hmmmm...I'll look at the test that failed.

Anyone know, though, why the external coverage from external is not available, or no code coverage driver is available? Is that because of the failed unit test?

@lloy0076
Copy link
Author

Bah!

I'll need to fiddle all the tests because I just realised that this change causes all the queries to look like they're nested and so a bunch of assertions are wrong.

So my diagnosis is:

  1. The tests are wrong;
  2. The code is correct.

I say this on the basis I have this in production, as such :)

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

Successfully merging this pull request may close these issues.

Searching Related Models Using OR
1 participant