stateful_enum icon indicating copy to clipboard operation
stateful_enum copied to clipboard

[Question] How should we prevent the after hook from running if we threw :abort in the before hook?

Open andychongyz opened this issue 3 years ago • 0 comments

Hi folks! Hope that it is okay to open up an issue for this question. The after hook ran even I throw :abort in the before hook, is this by design? Right now, I'm just using an if statement to check if I should continue to run the after hook. Is there a better way of doing this?

after do
  if status == "the status it should transitioned to"
    run the after transition code
  end
end

andychongyz avatar Jul 01 '22 03:07 andychongyz