platanus / activeadmin_addons

Extends ActiveAdmin to enable a set of great optional UX improving add-ons
MIT License
763 stars 288 forks source link

Fix searching for ids with selected list input #488

Closed vaot closed 1 year ago

vaot commented 1 year ago

Motivation / Background

When searching for multiple fields that include id, we need to force the predicate to eq. This is already done for other searchable inputs such as search_select and nested_select.

Detail

This Pull Request changes select-selected-list to force set the predicate to eq when the field is id.

Additional information

From:

{"groupings"=>{"0"=>{"m"=>"or", "name_cont"=>"test", "id_cont"=>"test"}}, "combinator"=>"and"}

To:

{"groupings"=>{"0"=>{"m"=>"or", "name_cont"=>"test", "id_eq"=>"test"}}, "combinator"=>"and"}

Checklist

Before submitting the PR make sure the following are checked:

Link action failing with: lint - Unauthorized

vaot commented 1 year ago

Hey @difernandez, do these changes make sense?