Commit 8da908f3 authored by Lucas Charles's avatar Lucas Charles

Fix Ruby 2.7 deprecations

Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/257438
parent b06f1cdd
...@@ -41,10 +41,8 @@ module API ...@@ -41,10 +41,8 @@ module API
note = ::Notes::CreateVisualReviewService.new( note = ::Notes::CreateVisualReviewService.new(
merge_request, merge_request,
current_user, current_user,
{
body: params[:body], body: params[:body],
position: params[:position] position: params[:position]
}
).execute ).execute
if note.valid? if note.valid?
......
...@@ -40,7 +40,7 @@ module API ...@@ -40,7 +40,7 @@ module API
params = { has_length: has_length } params = { has_length: has_length }
params[:maximum_size] = maximum_size unless has_length params[:maximum_size] = maximum_size unless has_length
::Packages::PackageFileUploader.workhorse_authorize(params) ::Packages::PackageFileUploader.workhorse_authorize(**params)
end end
def authorize_upload!(subject = user_project) def authorize_upload!(subject = user_project)
......
...@@ -23,7 +23,7 @@ module API ...@@ -23,7 +23,7 @@ module API
def initialize(object, options = {}) def initialize(object, options = {})
options = options.opts_hash if options.is_a?(Grape::Entity::Options) options = options.opts_hash if options.is_a?(Grape::Entity::Options)
super(object.present(options), options) super(object.present(options), **options)
end end
end end
end end
......
...@@ -42,7 +42,7 @@ module API ...@@ -42,7 +42,7 @@ module API
def package_finder(finder_params = {}) def package_finder(finder_params = {})
::Packages::Nuget::PackageFinder.new( ::Packages::Nuget::PackageFinder.new(
authorized_user_project, authorized_user_project,
finder_params.merge(package_name: params[:package_name]) **finder_params.merge(package_name: params[:package_name])
) )
end end
end end
......
...@@ -55,7 +55,7 @@ module API ...@@ -55,7 +55,7 @@ module API
export_strategy = if after_export_params[:url].present? export_strategy = if after_export_params[:url].present?
params = after_export_params.slice(:url, :http_method).symbolize_keys params = after_export_params.slice(:url, :http_method).symbolize_keys
Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy.new(params) Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy.new(**params)
end end
if export_strategy&.invalid? if export_strategy&.invalid?
......
...@@ -51,7 +51,7 @@ module API ...@@ -51,7 +51,7 @@ module API
def find_project_with_access(params) def find_project_with_access(params)
project = find_project!( project = find_project!(
::Gitlab::Jira::Dvcs.restore_full_path(params.slice(:namespace, :project).symbolize_keys) ::Gitlab::Jira::Dvcs.restore_full_path(**params.slice(:namespace, :project).symbolize_keys)
) )
not_found! unless can?(current_user, :download_code, project) not_found! unless can?(current_user, :download_code, project)
project project
......
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