before_action in bulk_create
I'm implementing some logic that would bulk_destroy existing records and bulk_create in a transaction
and then
but the
before_action gets called before every batch, what's the idiomatic way to achieve this behavior and having the before_action running only once in transaction?
Thanks4 Replies
When you say before every batch do you mean for each record?
You can define a change module and implement the batch callbacks to run code before the entire batch
IIRC this is covered in the multi step actions guide
Hexdocs Search Results
Searched
ash-3.5.15 for multi-step-actionsash-3.5.15 | extras
would that previous change in transaction?
Yes,
before_batch is in the same transaction as the batch