lib/acidic_job/mixin.rb in acidic_job-1.0.0.beta.5 vs lib/acidic_job/mixin.rb in acidic_job-1.0.0.beta.6

- old
+ new

@@ -79,15 +79,12 @@ raise RedefiningWorkflow if defined? @workflow_builder @workflow_builder = WorkflowBuilder.new raise MissingWorkflowBlock, "A block must be passed to `with_acidic_workflow`" unless block_given? + raise MissingBlockArgument, "An argument must be passed to the `with_acidic_workflow` block" if block.arity.zero? - if block.arity.zero? - @workflow_builder.instance_exec(&block) - else - yield @workflow_builder - end + block.call @workflow_builder raise NoDefinedSteps if @workflow_builder.steps.empty? # convert the array of steps into a hash of recovery_points and next steps workflow = @workflow_builder.define_workflow