Skip to content

Commit 82217ab

Browse files
committed
Fix Ruby 2.7 kwargs warnings
1 parent 11b8cdd commit 82217ab

File tree

11 files changed

+52
-52
lines changed

11 files changed

+52
-52
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def create_table(table_name, **options)
1313
res
1414
end
1515

16-
def drop_table(table_name, options = {})
16+
def drop_table(table_name, **options)
1717
# Mimic CASCADE option as best we can.
1818
if options[:force] == :cascade
1919
execute_procedure(:sp_fkeys, pktable_name: table_name).each do |fkdata|
@@ -555,8 +555,8 @@ def views_real_column_name(table_name, column_name)
555555
match_data ? match_data[1] : column_name
556556
end
557557

558-
def create_table_definition(*args)
559-
SQLServer::TableDefinition.new(self, *args)
558+
def create_table_definition(*args, **options)
559+
SQLServer::TableDefinition.new(self, *args, **options)
560560
end
561561

562562
end

lib/active_record/connection_adapters/sqlserver/table_definition.rb

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,86 +14,86 @@ def primary_key(name, type = :primary_key, **options)
1414
super
1515
end
1616

17-
def primary_key_nonclustered(*args, **options)
18-
args.each { |name| column(name, :primary_key_nonclustered, options) }
17+
def primary_key_nonclustered(*names, **options)
18+
names.each { |name| column(name, :primary_key_nonclustered, **options) }
1919
end
2020

21-
def real(*args, **options)
22-
args.each { |name| column(name, :real, options) }
21+
def real(*names, **options)
22+
names.each { |name| column(name, :real, **options) }
2323
end
2424

25-
def money(*args, **options)
26-
args.each { |name| column(name, :money, options) }
25+
def money(*names, **options)
26+
names.each { |name| column(name, :money, **options) }
2727
end
2828

29-
def smalldatetime(*args, **options)
30-
args.each { |name| column(name, :smalldatetime, options) }
29+
def smalldatetime(*names, **options)
30+
names.each { |name| column(name, :smalldatetime, **options) }
3131
end
3232

33-
def datetime(*args, **options)
34-
args.each do |name|
33+
def datetime(*names, **options)
34+
names.each do |name|
3535
if options[:precision]
36-
datetime2(name, options)
36+
datetime2(name, **options)
3737
else
38-
column(name, :datetime, options)
38+
column(name, :datetime, **options)
3939
end
4040
end
4141
end
4242

43-
def datetime2(*args, **options)
44-
args.each { |name| column(name, :datetime2, options) }
43+
def datetime2(*names, **options)
44+
names.each { |name| column(name, :datetime2, **options) }
4545
end
4646

47-
def datetimeoffset(*args, **options)
48-
args.each { |name| column(name, :datetimeoffset, options) }
47+
def datetimeoffset(*names, **options)
48+
names.each { |name| column(name, :datetimeoffset, **options) }
4949
end
5050

51-
def smallmoney(*args, **options)
52-
args.each { |name| column(name, :smallmoney, options) }
51+
def smallmoney(*names, **options)
52+
names.each { |name| column(name, :smallmoney, **options) }
5353
end
5454

55-
def char(*args, **options)
56-
args.each { |name| column(name, :char, options) }
55+
def char(*names, **options)
56+
names.each { |name| column(name, :char, **options) }
5757
end
5858

59-
def varchar(*args, **options)
60-
args.each { |name| column(name, :varchar, options) }
59+
def varchar(*names, **options)
60+
names.each { |name| column(name, :varchar, **options) }
6161
end
6262

63-
def varchar_max(*args, **options)
64-
args.each { |name| column(name, :varchar_max, options) }
63+
def varchar_max(*names, **options)
64+
names.each { |name| column(name, :varchar_max, **options) }
6565
end
6666

67-
def text_basic(*args, **options)
68-
args.each { |name| column(name, :text_basic, options) }
67+
def text_basic(*names, **options)
68+
names.each { |name| column(name, :text_basic, **options) }
6969
end
7070

71-
def nchar(*args, **options)
72-
args.each { |name| column(name, :nchar, options) }
71+
def nchar(*names, **options)
72+
names.each { |name| column(name, :nchar, **options) }
7373
end
7474

75-
def ntext(*args, **options)
76-
args.each { |name| column(name, :ntext, options) }
75+
def ntext(*names, **options)
76+
names.each { |name| column(name, :ntext, **options) }
7777
end
7878

79-
def binary_basic(*args, **options)
80-
args.each { |name| column(name, :binary_basic, options) }
79+
def binary_basic(*names, **options)
80+
names.each { |name| column(name, :binary_basic, **options) }
8181
end
8282

83-
def varbinary(*args, **options)
84-
args.each { |name| column(name, :varbinary, options) }
83+
def varbinary(*names, **options)
84+
names.each { |name| column(name, :varbinary, **options) }
8585
end
8686

87-
def uuid(*args, **options)
88-
args.each { |name| column(name, :uniqueidentifier, options) }
87+
def uuid(*names, **options)
88+
names.each { |name| column(name, :uniqueidentifier, **options) }
8989
end
9090

91-
def ss_timestamp(*args, **options)
92-
args.each { |name| column(name, :ss_timestamp, options) }
91+
def ss_timestamp(*names, **options)
92+
names.each { |name| column(name, :ss_timestamp, **options) }
9393
end
9494

95-
def json(*args, **options)
96-
args.each { |name| column(name, :text, options) }
95+
def json(*names, **options)
96+
names.each { |name| column(name, :text, **options) }
9797
end
9898

9999
end

lib/active_record/connection_adapters/sqlserver/transaction.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module SQLServerRealTransaction
3232

3333
attr_reader :starting_isolation_level
3434

35-
def initialize(connection, options, *args)
35+
def initialize(connection, options, **args)
3636
@connection = connection
3737
@starting_isolation_level = current_isolation_level if options[:isolation]
3838
super

lib/active_record/connection_adapters/sqlserver/type/money.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class Money < Decimal
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@precision = 19
1010
@scale = 4

lib/active_record/connection_adapters/sqlserver/type/small_money.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class SmallMoney < Money
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@precision = 10
1010
@scale = 4

lib/active_record/connection_adapters/sqlserver/type/unicode_varchar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class UnicodeVarchar < UnicodeChar
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@limit = 4000 if @limit.to_i == 0
1010
end

lib/active_record/connection_adapters/sqlserver/type/unicode_varchar_max.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class UnicodeVarcharMax < UnicodeVarchar
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@limit = 2_147_483_647
1010
end

lib/active_record/connection_adapters/sqlserver/type/varbinary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class Varbinary < Binary
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@limit = 8000 if @limit.to_i == 0
1010
end

lib/active_record/connection_adapters/sqlserver/type/varbinary_max.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class VarbinaryMax < Varbinary
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@limit = 2_147_483_647
1010
end

lib/active_record/connection_adapters/sqlserver/type/varchar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class Varchar < Char
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@limit = 8000 if @limit.to_i == 0
1010
end

lib/active_record/connection_adapters/sqlserver/type/varchar_max.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module SQLServer
44
module Type
55
class VarcharMax < Varchar
66

7-
def initialize(*args)
7+
def initialize(**args)
88
super
99
@limit = 2_147_483_647
1010
end

0 commit comments

Comments
 (0)