diff --git a/app/components/avo/media_library/list_component.rb b/app/components/avo/media_library/list_component.rb index b9b06a7aeb..c085473916 100644 --- a/app/components/avo/media_library/list_component.rb +++ b/app/components/avo/media_library/list_component.rb @@ -18,7 +18,7 @@ def controller = Avo::Current.view_context.controller def query ActiveStorage::Blob.includes(:attachments) # ignore blobs who are just a variant to avoid "n+1" blob creation - .where.not(id: ActiveStorage::Attachment.where(record_type: "ActiveStorage::VariantRecord").pluck(:blob_id)) + .where.not(id: ActiveStorage::Attachment.where(record_type: "ActiveStorage::VariantRecord").select(:blob_id)) .order(created_at: :desc) end