dry-transaction
dry-transaction copied to clipboard
Custom step adapters documentation bug
Describe the bug
In the documentation of dry-transaction section Custom step adapters there is a code snippet:
QUEUE = []
class MyStepAdapters < Dry::Transaction::StepAdapters
register :enqueue, -> step, input, *args {
# In a real app, this would push the operation into a background worker queue
QUEUE << step.operation.call(input, *args)
Dry::Monads.Success(input)
}
end
However actual interface is different.
To Reproduce
Expected behavior
Code snippet in documentation needs to be updated to something like:
QUEUE = []
class MyStepAdapters < Dry::Transaction::StepAdapters
register :enqueue, ->(operation, _options, args) {
# In a real app, this would push the operation into a background worker queue
QUEUE << operation.call(*args))
Dry::Monads.Success(input)
}
end
Also text describing interface (#call(step, input, *args)) needs to be updated accordingly.
Your environment
- Affects my production application: NO
- Ruby version: 2.6.3
- OS: Linux/5.3.8-gentoo
You can submit a PR for the docs by going to the page and clicking "Edit in Github" 👍