Skip to content

Commit

Permalink
move query in pg
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Jan 31, 2025
1 parent bc5e53c commit c05fd68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/avo/media_library/list_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c05fd68

Please sign in to comment.