Skip to content

Commit 80c3b9d

Browse files
committed
fixed tests
1 parent 2b56e52 commit 80c3b9d

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

lib/active_record/connection_adapters/sqlserver/schema_creation.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
module ActiveRecord
44
module ConnectionAdapters
55
module SQLServer
6-
class SchemaCreation < SchemaCreation
6+
BASE_SCHEMA_CREATION_CLASS = ((ActiveRecord.version <=> Gem::Version.new("6.1")) != -1) ?
7+
SchemaCreation :
8+
AbstractAdapter::SchemaCreation
9+
10+
class SchemaCreation < BASE_SCHEMA_CREATION_CLASS
711
private
812

913
def visit_TableDefinition(o)

lib/active_record/connection_adapters/sqlserver/transaction.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,18 @@ def current_isolation_level
3131
module SQLServerRealTransaction
3232
attr_reader :starting_isolation_level
3333

34-
def initialize(connection, isolation: nil, joinable: true, run_commit_callbacks: false)
35-
@connection = connection
36-
@starting_isolation_level = current_isolation_level if isolation
37-
super
34+
if (ActiveRecord.version <=> Gem::Version.new("6.1")) != -1
35+
def initialize(connection, **args)
36+
@connection = connection
37+
@starting_isolation_level = current_isolation_level if args[:isolation]
38+
super
39+
end
40+
else
41+
def initialize(connection, options, **args)
42+
@connection = connection
43+
@starting_isolation_level = current_isolation_level if options[:isolation]
44+
super
45+
end
3846
end
3947

4048
def commit

0 commit comments

Comments
 (0)