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

Added `filterOpt` and `filterIf` to `Query`. #1909

Merged
merged 1 commit into from May 19, 2018

Conversation

Projects
None yet
3 participants
@Asamsig
Copy link
Contributor

Asamsig commented May 19, 2018

Fixes #1820

Added examples to the documentation.

Created a new test class(QueryMethodTest) for filterOpt and filterIf. I had a hard time finding a good place to put the tests, so I decided on a clean test class.

@Asamsig Asamsig force-pushed the Asamsig:issue/1820-optional-filter branch from 046246b to 8af82d4 May 19, 2018

Added `filterOpt` and `filterIf` to `Query`.
Added examples of both to the documentation.

@Asamsig Asamsig force-pushed the Asamsig:issue/1820-optional-filter branch from 8af82d4 to 4483227 May 19, 2018

@hvesalai hvesalai added this to the 3.3 milestone May 19, 2018

@hvesalai hvesalai merged commit 3b930b4 into slick:master May 19, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
typesafe-cla-validator All users have signed the CLA
Details

@d6y d6y referenced this pull request May 21, 2018

Closed

Add filterOpt/filterIf #163

optValue.map(v => withFilter(a => f(a, v))).getOrElse(this)

/** Applies the given predicate, if the given boolean parameter evaluates to true,
* if the value is not present, the predicate will not be part of the query. */

This comment has been minimized.

@kubukoz

kubukoz May 25, 2018

Probably meant if the value evaluates to false - "not present" doesn't really match a boolean (I assume it's a copy-paste issue)

This comment has been minimized.

@hvesalai

hvesalai May 26, 2018

Member

👍 I'll make the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment