Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix keyword arguments errors for Ruby 2.8.0-dev #1977

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module OracleEnhanced
class SchemaCreation < SchemaCreation
private
def visit_ColumnDefinition(o)
if [:blob, :clob, :nclob].include?(sql_type = type_to_sql(o.type, o.options).downcase.to_sym)
if [:blob, :clob, :nclob].include?(sql_type = type_to_sql(o.type, **o.options).downcase.to_sym)
if (tablespace = default_tablespace_for(sql_type))
@lob_tablespaces ||= {}
@lob_tablespaces[o.name] = tablespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def primary_key(name, type = :primary_key, **options)
].each do |column_type|
module_eval <<-CODE, __FILE__, __LINE__ + 1
def #{column_type}(*args, **options)
args.each { |name| column(name, :#{column_type}, options) }
args.each { |name| column(name, :#{column_type}, **options) }
end
CODE
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def columns(table_name)
def create_table(table_name, id: :primary_key, primary_key: nil, force: nil, **options)
create_sequence = id != false
td = create_table_definition(
table_name, options.extract!(:temporary, :options, :as, :comment, :tablespace, :organization)
table_name, **options.extract!(:temporary, :options, :as, :comment, :tablespace, :organization)
)

if id && !td.as
Expand All @@ -208,7 +208,7 @@ def create_table(table_name, id: :primary_key, primary_key: nil, force: nil, **o
if pk.is_a?(Array)
td.primary_keys pk
else
td.primary_key pk, id, options
td.primary_key pk, id, **options
end
end

Expand Down Expand Up @@ -293,7 +293,7 @@ def insert_versions_sql(versions) # :nodoc:
end

def add_index(table_name, column_name, options = {}) #:nodoc:
index_name, index_type, quoted_column_names, tablespace, index_options = add_index_options(table_name, column_name, options)
index_name, index_type, quoted_column_names, tablespace, index_options = add_index_options(table_name, column_name, **options)
execute "CREATE #{index_type} INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} (#{quoted_column_names})#{tablespace} #{index_options}"
if index_type == "UNIQUE"
unless /\(.*\)/.match?(quoted_column_names)
Expand Down Expand Up @@ -407,8 +407,8 @@ def remove_synonym(name)
execute "DROP SYNONYM #{quote_table_name(name)}"
end

def add_reference(table_name, *args)
OracleEnhanced::ReferenceDefinition.new(*args).add_to(update_table_definition(table_name, self))
def add_reference(table_name, ref_name, **options)
OracleEnhanced::ReferenceDefinition.new(ref_name, **options).add_to(update_table_definition(table_name, self))
end

def add_column(table_name, column_name, type, **options) #:nodoc:
Expand Down Expand Up @@ -458,7 +458,7 @@ def change_column(table_name, column_name, type, options = {}) #:nodoc:
end

td = create_table_definition(table_name)
cd = td.new_column_definition(column.name, type, options)
cd = td.new_column_definition(column.name, type, **options)
change_column_stmt = schema_creation.accept cd
change_column_stmt << tablespace_for((type_to_sql(type).downcase.to_sym), nil, options[:table_name], options[:column_name]) if type
change_column_sql = "ALTER TABLE #{quote_table_name(table_name)} MODIFY #{change_column_stmt}"
Expand Down