Skip to content

[Fix #50118] `:prepend` option not working with `run_after_transaction_callbacks_in_order_defined` config

Created by: joshuay03

Motivation / Background

Fixes #50118.

Detail

Ensures that the :prepend option for after transaction callbacks is respected when config.run_after_transaction_callbacks_in_order_defined = true. This allows prepending certain after_commit and after_rollback callbacks while still running the rest in the order defined on the model.

Additional information

In addition to the tests here there is also this script which I tested against.

cc @ghiculescu

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Merge request reports