diff --git a/app/models/binary_blob/purging.rb b/app/models/binary_blob/purging.rb index 3f3f2978a582..fc853f128c9d 100644 --- a/app/models/binary_blob/purging.rb +++ b/app/models/binary_blob/purging.rb @@ -13,7 +13,7 @@ def purge_window_size end def purge_scope(_older_than = nil) - where(:resource => nil) + where(:resource_type => 'MiqQueue').where.not('resource_id in (select id from miq_queue)') end def purge_associated_records(ids) diff --git a/app/models/miq_queue.rb b/app/models/miq_queue.rb index ad53182a8b6c..74e3e08239d7 100644 --- a/app/models/miq_queue.rb +++ b/app/models/miq_queue.rb @@ -19,7 +19,7 @@ # class MiqQueue < ApplicationRecord belongs_to :handler, :polymorphic => true - has_many :binary_blobs, :as => :resource, :dependent => :nullify + has_many :binary_blobs, :as => :resource attr_accessor :last_exception