Commit 7e29df2
committed
Prioritize filters with predicates in active filter labels (#7702)
When there are filters for a single field and a multi-field ransack
search with predicate, the multi-field label on the active filter
should use the custom label from the filter input box.
Reproduction steps:
./app/admin/posts.rb
```
ActiveAdmin.register Post do
filter :title_or_body_contains, as: :string, label: 'Title or Body'
filter :title, as: :string
...
end
```
Navigate to the posts path for a user like
`localhost:3000/admin/users/4/posts`
Complete search in both fields, note that both active filters use the
label "Title contains". The `title_or_body_contains` should use the
label from the filter "Title or Body contains".1 parent 12c39a7 commit 7e29df2
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
193 | 211 | | |
194 | 212 | | |
195 | 213 | | |
| |||
0 commit comments