Skip to content

Commit

Permalink
only use updated initialize arguments in SQLServerRealTransaction for…
Browse files Browse the repository at this point in the history
… rails 6.1
  • Loading branch information
lk0001 committed Jan 19, 2021
1 parent 673463d commit 1a800df
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/active_record/connection_adapters/sqlserver/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ def current_isolation_level
module SQLServerRealTransaction
attr_reader :starting_isolation_level

def initialize(connection, **args)
@connection = connection
@starting_isolation_level = current_isolation_level if args[:isolation]
super
if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
def initialize(connection, **args)
@connection = connection
@starting_isolation_level = current_isolation_level if args[:isolation]
super
end
else
def initialize(connection, options, **args)
@connection = connection
@starting_isolation_level = current_isolation_level if options[:isolation]
super
end
end

def commit
Expand Down

0 comments on commit 1a800df

Please sign in to comment.