Skip to content

Commit 484b56c

Browse files
jpawlynphstcmensfeld
authored
Add enqueue_after_transaction_commit? for Rails 7.2 compatibility (#777)
* Add enqueue_after_transaction_commit? for Rails 7.2 compatibility * Better to inherit from ActiveJob::QueueAdapters::AbstractAdapter and the default for enqueue_after_transaction_commit? is true - see https://github.com/rails/rails/pull/51426/files#diff-572a695cc044413e9d509392a9230f9fbe8a039518f3e438a3c88f2b6a259480 * Remove test since it does not add much value and it complicates testing agaainst rails versions less than 7.2 * Attempt to fix CI ActiveJob::QueueAdapters::AbstractAdapter was only introduced in Rails 7.2.0 so let's retain compatability with older Rails versions by not referencing it --------- Co-authored-by: Pablo Cantero <pablohstc@gmail.com> Co-authored-by: Maciej Mensfeld <maciej@mensfeld.pl>
1 parent cfedc73 commit 484b56c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/shoryuken/extensions/active_job_adapter.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def enqueue_at(job, timestamp)
3030
end
3131
end
3232

33+
# only required for Rails 7.2.x
34+
def enqueue_after_transaction_commit?
35+
true
36+
end
37+
3338
def enqueue(job, options = {}) #:nodoc:
3439
register_worker!(job)
3540

0 commit comments

Comments
 (0)