diff options
Diffstat (limited to 'app/models/bulk_imports/tracker.rb')
-rw-r--r-- | app/models/bulk_imports/tracker.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/bulk_imports/tracker.rb b/app/models/bulk_imports/tracker.rb index d1a6f3b9a80..d9efd489af5 100644 --- a/app/models/bulk_imports/tracker.rb +++ b/app/models/bulk_imports/tracker.rb @@ -33,11 +33,9 @@ class BulkImports::Tracker < ApplicationRecord entity_scope.where(stage: next_stage_scope).with_status(:created) } - def self.stage_running?(entity_id, stage) - where(stage: stage, bulk_import_entity_id: entity_id) - .with_status(:created, :enqueued, :started) - .exists? - end + scope :running_trackers, -> (entity_id) { + where(bulk_import_entity_id: entity_id).with_status(:enqueued, :started) + } def pipeline_class unless entity.pipeline_exists?(pipeline_name) |