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.
2 parents 4c724df + a1d9602 commit 3757222Copy full SHA for 3757222
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