Skeep transaction


#1

Hi,
is there a way to skip a step in a transaction ?
Something like a “skip_step” alias

step :step1
step :step2

def step1
  skip_step if condition
  ...
end

def step2
...
end

or better :

step :step1, only: [:is_condition]
step :step2

def is_condition
  true === @condition
end

#2

The best I can think of is to create a custom step adapter, check the docs here https://dry-rb.org/gems/dry-transaction/custom-step-adapters/


#3

You can pass additional argument to a step https://dry-rb.org/gems/dry-transaction/basic-usage/#passing-additional-step-arguments