-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
I'm not sure if this is possible or if it is a feature request, but I'd like to be able to do something like has_scope :region_id, type: [:default, :array]. I don't necessarily know how the user will be passing the data so it could be an integer, e.g. ?region_id=1 or an array, e.g. ?region_id[]=1®ion_id[]=2. I did try the following and it did NOT work.
has_scope :region_id, if: ->(request) { request.params[:region_id].is_a? String }
has_scope :region_id, type: :array, if: ->(request) { request.params[:region_id].is_a? Array }Metadata
Metadata
Assignees
Labels
No labels