Commit 30e2a8f0 authored by Jasper Maes's avatar Jasper Maes

Fix several ActionController::Parameters deprecations

parent fe4f8cad
...@@ -35,7 +35,7 @@ module Groups ...@@ -35,7 +35,7 @@ module Groups
def setup_children(parent) def setup_children(parent)
@children = GroupDescendantsFinder.new(current_user: current_user, @children = GroupDescendantsFinder.new(current_user: current_user,
parent_group: parent, parent_group: parent,
params: params).execute params: params.to_unsafe_h).execute
@children = @children.page(params[:page]) @children = @children.page(params[:page])
end end
end end
......
...@@ -93,7 +93,7 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -93,7 +93,7 @@ class Projects::BlobController < Projects::ApplicationController
@blob.load_all_data! @blob.load_all_data!
@lines = @blob.present.highlight.lines @lines = @blob.present.highlight.lines
@form = UnfoldForm.new(params) @form = UnfoldForm.new(params.to_unsafe_h)
@lines = @lines[@form.since - 1..@form.to - 1].map(&:html_safe) @lines = @lines[@form.since - 1..@form.to - 1].map(&:html_safe)
......
...@@ -4,6 +4,6 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController ...@@ -4,6 +4,6 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController
before_action :authorize_admin_pipeline! before_action :authorize_admin_pipeline!
def show def show
redirect_to project_settings_ci_cd_path(@project, params: params) redirect_to project_settings_ci_cd_path(@project, params: params.to_unsafe_h)
end end
end end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Labels module Labels
class CreateService < Labels::BaseService class CreateService < Labels::BaseService
def initialize(params = {}) def initialize(params = {})
@params = params.dup.with_indifferent_access @params = params.to_h.dup.with_indifferent_access
end end
# returns the created label # returns the created label
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Labels module Labels
class UpdateService < Labels::BaseService class UpdateService < Labels::BaseService
def initialize(params = {}) def initialize(params = {})
@params = params.dup.with_indifferent_access @params = params.to_h.dup.with_indifferent_access
end end
# returns the updated label # returns the updated label
......
...@@ -12,7 +12,7 @@ module Lfs ...@@ -12,7 +12,7 @@ module Lfs
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def find_locks def find_locks
options = params.slice(:id, :path).compact.symbolize_keys options = params.slice(:id, :path).to_h.compact.symbolize_keys
project.lfs_file_locks.where(options) project.lfs_file_locks.where(options)
end end
......
...@@ -55,7 +55,7 @@ module Users ...@@ -55,7 +55,7 @@ module Users
params.reject! { |key, _| read_only.include?(key.to_sym) } params.reject! { |key, _| read_only.include?(key.to_sym) }
end end
@user.assign_attributes(params) if params.any? @user.assign_attributes(params) unless params.empty?
end end
end end
end end
---
title: Fix several ActionController::Parameters deprecations
merge_request: 24332
author: Jasper Maes
type: other
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