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

Enum querying using "or" condition #106

Open
hgani opened this issue Jul 2, 2015 · 2 comments
Open

Enum querying using "or" condition #106

hgani opened this issue Jul 2, 2015 · 2 comments

Comments

@hgani
Copy link

hgani commented Jul 2, 2015

Hi,

Sorry if I've missed it but I haven't found any info for easily querying using "or" conditions.

Let say we have:

as_enum :status, { active: 0, pending: 1, declined: 11 }

And we want to query records that are either active or pending. It doesn't seem that there's a shortcut for doing this yet. I think this can be implemented as part of the solution suggested in #95

So, we can do something like the following:

Item.where_with_enum(status: [:active, :pending])

Thanks

@lwe
Copy link
Owner

lwe commented Jul 3, 2015

Good point, it indeed makes sense to support this and I think we would get support for this out of the box.

@aledalgrande
Copy link
Contributor

I think this one can be associated to #95 and closed.

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

No branches or pull requests

3 participants