1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test
Edouard CHIN 0cdeee428e Fix AJ wrong deprecation message on after_callbacks_if_terminated:
- ### Problem

  In some cirumstances, the deprecation message to warn that AJ won't
  run `after_(enqueue/perform)` callbacks when the chain is halted
  by a `throw(:abort)` will be thrown even though no `throw(:abort)`
  was thrown.

  ```ruby
    run_callback(:foo) do
      ...
    end
  ```

  There is two possible way for the callback body to not be executed:

  1) `before` callback throw a `abort`
  2) `before` callback raises an error which is rescued by an
     around callback (See associated test in this commit for
     an example)

  When 2) happen we don't want to output a deprecation message,
  because what the message says isn't true and doesn't apply.

  ### Solution

  In order to differentiate between 1) and 2), I have added
  a `halted_callback_hook` which is called by ActiveSupport callback
  whenever the callback chain is halted.
2020-03-03 16:17:55 -04:00
..
adapters Remove support for Qu gem. 2018-03-19 21:27:16 +01:00
cases Fix AJ wrong deprecation message on after_callbacks_if_terminated: 2020-03-03 16:17:55 -04:00
integration Run inline jobs in separate threads 2019-11-01 20:14:40 -04:00
jobs Fix ActiveJob Test adapter not respecting retry attempts: 2020-02-10 17:59:20 -04:00
models [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
support Tidy up the build output for Active Job adapters 2019-10-23 20:47:50 +10:30
helper.rb Set AJ return_false_on_aborted_enqueue true in the test suite: 2019-12-28 16:56:54 +01:00