method

with_attached_*

rails latest stable - Class: ActiveStorage::Attached::Model
with_attached_*
public

Includes the attached blobs in your query to avoid N+1 queries.

If ActiveStorage.track_variants is enabled, it will also include the variants record and their attached blobs.

User.with_attached_avatar

Use the plural form for has_many_attached:

Gallery.with_attached_photos