-
Yuji Yaginuma authored
The current code expects `active_record` to be loaded before `active_job`. But I think there are no guarantees about load orders. At least, `active_job` is loaded before `active_record` in a newer application. In that case, `EnqueueAfterTransactionCommit` isn't loaded and an application that uses `enqueue_after_transaction_commit` in jobs will fail with the following error. ``` app/jobs/user_job.rb:2:in `<class:UserJob>': undefined method `enqueue_after_transaction_commit=' for class UserJob (NoMethodError) ``` I removed `active_record` hook to fix this. Active Record are onld used inside methods in ``EnqueueAfterTransactionCommit`. So I think it's safe to load the module without Active Record.
Yuji Yaginuma authoredThe current code expects `active_record` to be loaded before `active_job`. But I think there are no guarantees about load orders. At least, `active_job` is loaded before `active_record` in a newer application. In that case, `EnqueueAfterTransactionCommit` isn't loaded and an application that uses `enqueue_after_transaction_commit` in jobs will fail with the following error. ``` app/jobs/user_job.rb:2:in `<class:UserJob>': undefined method `enqueue_after_transaction_commit=' for class UserJob (NoMethodError) ``` I removed `active_record` hook to fix this. Active Record are onld used inside methods in ``EnqueueAfterTransactionCommit`. So I think it's safe to load the module without Active Record.
Loading