From d2f4e776b343ad0fe2f71e531204e636026e7662 Mon Sep 17 00:00:00 2001 From: Dante Soares Date: Mon, 11 Mar 2024 17:11:28 -0500 Subject: [PATCH] Apply the fix to 8.0 as well --- lib/lev/routine.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lev/routine.rb b/lib/lev/routine.rb index 80dccad..ffe1f6b 100644 --- a/lib/lev/routine.rb +++ b/lib/lev/routine.rb @@ -495,7 +495,8 @@ def runner=(runner) def in_transaction(options={}) if transaction_run_by?(self) isolation_symbol = self.class.transaction_isolation.symbol - if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1 && + if (ActiveRecord::VERSION::MAJOR >= 8 || + (ActiveRecord::VERSION::MAJOR == 7 && ActiveRecord::VERSION::MINOR >= 1)) && ActiveRecord::Base.connection.transaction_open? # Don't even try to set transaction isolation if the transaction is already open ActiveRecord::Base.transaction do