Commit eae8d62f authored by Stan Hu's avatar Stan Hu

Fix Ruby 2.7 deprecation warnings in migration helpers

Per https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/,
the automatic conversion of keyword arguments and positional arguments
is deprecated. Now we have to be explicit about the differences.
parent d487b9e2
......@@ -176,7 +176,7 @@ module Gitlab
name: name.presence || concurrent_foreign_key_name(source, column)
}
if foreign_key_exists?(source, target, options)
if foreign_key_exists?(source, target, **options)
warning_message = "Foreign key not created because it exists already " \
"(this may be due to an aborted migration or similar): " \
"source: #{source}, target: #{target}, column: #{options[:column]}, "\
......@@ -330,13 +330,13 @@ module Gitlab
# * +timing_configuration+ - [[ActiveSupport::Duration, ActiveSupport::Duration], ...] lock timeout for the block, sleep time before the next iteration, defaults to `Gitlab::Database::WithLockRetries::DEFAULT_TIMING_CONFIGURATION`
# * +logger+ - [Gitlab::JsonLogger]
# * +env+ - [Hash] custom environment hash, see the example with `DISABLE_LOCK_RETRIES`
def with_lock_retries(**args, &block)
def with_lock_retries(*args, **kwargs, &block)
merged_args = {
klass: self.class,
logger: Gitlab::BackgroundMigration::Logger
}.merge(args)
}.merge(kwargs)
Gitlab::Database::WithLockRetries.new(merged_args).run(&block)
Gitlab::Database::WithLockRetries.new(**merged_args).run(&block)
end
def true_value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment