File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ accepts these nested keys under `filters[<name>]`:
225225| Key | Meaning |
226226| ------------------------| ----------------------------------------------------|
227227| ` present ` | strict true or bare key → attached; explicit false (` 'false' ` , ` '0' ` ) → unattached |
228- | ` type ` | blob content type — scalar ` = ` , array ` IN ` |
228+ | ` type ` | blob content type — scalar ` = ` , array ` IN ` , or the ` image ` shortcut |
229229| ` min_size ` / ` max_size ` | inclusive blob byte size bounds |
230230
231231``` ruby
237237
238238Contract .filterable(filters: { document: { present: true } })
239239Contract .filterable(filters: { document: { type: %w[application/pdf image/png] , max_size: 5_000_000 } })
240+ Contract .filterable(filters: { document: { type: ' image' } })
240241```
241242
243+ The ` image ` shortcut expands at query time against
244+ ` ActiveStorage.variable_content_types ` + ` web_image_content_types ` (a real
245+ content type always carries a slash, so the name is unambiguous), and composes
246+ inside arrays next to literal types. An unknown literal stays a plain equality
247+ that matches nothing; an unknown symbol narrows nothing.
248+
242249Everything resolves through the associations ` has_one_attached ` /
243250` has_many_attached ` generate, so the gem still has no ActiveStorage
244251dependency; a declared name without those associations narrows nothing, and
You can’t perform that action at this time.
0 commit comments