Skip to content

Commit

Permalink
Fix compatibility with adapters that don't support savepoints
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Sep 26, 2024
1 parent bbe18f6 commit dd89ce9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sequel/extensions/activerecord_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def timezone
# information to know whether we're in a transaction, whether to create a
# savepoint, when to run transaction/savepoint hooks etc.
def _trans(conn)
hash = super || { savepoints: [], activerecord: true }
hash = super || { activerecord: true }

# adapters that don't support savepoints won't have this assigned
hash[:savepoints] ||= []

# add any ActiveRecord transactions/savepoints that have been opened
# directly via ActiveRecord::Base.transaction
Expand Down

0 comments on commit dd89ce9

Please sign in to comment.