Skip to content

Filtering on boolean properties? #125

Description

@jwilliams-t3

I have a model that has a boolean property 'protected'. In MySql it's stored as a tinyint with a value of 0 or 1. In my serializer I would like to filter on the property so I added:

can_filter_by :protected

Unfortunately, this means the url parameter must use 0 or 1 instead of 'true' or 'false':

http://localhost:3000/v1/profiles?protected=1

Is it possible to support 'true' or 'false'?

http://localhost:3000/v1/profiles?protected=true

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