Skip to content

1.2.0: Allow to change callbacks action when called outside transaction

Choose a tag to compare

@github-actions github-actions released this 26 Mar 12:22
v1.2.0
71db9ac

Added

  • Allow to change callbacks' behavior when they are called outside transaction:

    AfterCommitEverywhere.after_commit(without_tx: :raise) do
      # Will be executed only if was called within transaction
      # Error will be raised otherwise
    end

    Available values for without_tx keyword argument:

    • :execute to execute callback immediately
    • :warn_and_execute to print warning and execute immediately
    • :raise to raise an exception instead of executing

    Pull request #18 by [@lolripgg][].