We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c724df commit a1d9602Copy full SHA for a1d9602
activestorage/app/models/active_storage/blob.rb
@@ -46,7 +46,7 @@ class ActiveStorage::Blob < ActiveRecord::Base
46
47
has_many :attachments
48
49
- scope :unattached, -> { left_joins(:attachments).where(ActiveStorage::Attachment.table_name => { blob_id: nil }) }
+ scope :unattached, -> { where.missing(:attachments) }
50
51
after_initialize do
52
self.service_name ||= self.class.service.name
0 commit comments