Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
This repository was archived by the owner on Apr 17, 2018. It is now read-only.

Flag should be searchable bitwise #44

Description

@agios

When one is using a flag field, they should be able to search for records that have a specific flag set. This can be done with a bitwise "and" query, using the ampersand operator.

I don't know what the correct way to do this is, but a method that works for me is defining a new Comparison, as such: http://pastebin.com/xWU62iT2

That way one can do a search like this:

User.all('role.hasflag' => :moderator)

and it will match users with that AND other roles, not just the specific combination

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions