lib/acidic_job/mixin.rb in acidic_job-1.0.0.beta.3 vs lib/acidic_job/mixin.rb in acidic_job-1.0.0.beta.4
- old
+ new
@@ -5,13 +5,10 @@
module AcidicJob
module Mixin
extend ActiveSupport::Concern
def self.wire_up(other)
- raise UnknownJobAdapter unless (defined?(::ActiveJob::Base) && other < ::ActiveJob::Base) ||
- (defined?(::Sidekiq::Worker) && other.include?(::Sidekiq::Worker))
-
# Ensure our `perform` method always runs first to gather parameters
# and run perform callbacks for Sidekiq workers
other.prepend PerformWrapper
# By default, we unique job runs by the `job_id`
@@ -74,9 +71,12 @@
def safely_finish_acidic_job
FinishedPoint.new
end
def with_acidic_workflow(persisting: {}, &block)
+ raise UnknownJobAdapter unless (defined?(::AcidicJob::Base) && self.class < ::AcidicJob::Base) ||
+ (defined?(::AcidicJob::ActiveKiq) && self.class < ::AcidicJob::ActiveKiq)
+
raise RedefiningWorkflow if defined? @workflow_builder
@workflow_builder = WorkflowBuilder.new
raise MissingWorkflowBlock, "A block must be passed to `with_acidic_workflow`" unless block_given?