Commit a3049115 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'rs-except-deprecation' into 'master'

Change deprecated `except!` usages

Closes #54094

See merge request gitlab-org/gitlab-ce!23844
parents eb15869f 7a07be56
...@@ -36,7 +36,7 @@ module Groups ...@@ -36,7 +36,7 @@ module Groups
end end
def reject_parent_id! def reject_parent_id!
params.except!(:parent_id) params.delete(:parent_id)
end end
def valid_share_with_group_lock_change? def valid_share_with_group_lock_change?
......
...@@ -5,14 +5,15 @@ module MergeRequests ...@@ -5,14 +5,15 @@ module MergeRequests
def execute(merge_request) def execute(merge_request)
# We don't allow change of source/target projects and source branch # We don't allow change of source/target projects and source branch
# after merge request was created # after merge request was created
params.except!(:source_project_id) params.delete(:source_project_id)
params.except!(:target_project_id) params.delete(:target_project_id)
params.except!(:source_branch) params.delete(:source_branch)
merge_from_quick_action(merge_request) if params[:merge] merge_from_quick_action(merge_request) if params[:merge]
if merge_request.closed_without_fork? if merge_request.closed_without_fork?
params.except!(:target_branch, :force_remove_source_branch) params.delete(:target_branch)
params.delete(:force_remove_source_branch)
end end
if params[:force_remove_source_branch].present? if params[:force_remove_source_branch].present?
......
...@@ -16,7 +16,7 @@ module Users ...@@ -16,7 +16,7 @@ module Users
user_exists = @user.persisted? user_exists = @user.persisted?
assign_attributes(&block) assign_attributes
if @user.save(validate: validate) && update_status if @user.save(validate: validate) && update_status
notify_success(user_exists) notify_success(user_exists)
...@@ -48,9 +48,11 @@ module Users ...@@ -48,9 +48,11 @@ module Users
success success
end end
def assign_attributes(&block) def assign_attributes
if @user.user_synced_attributes_metadata if (metadata = @user.user_synced_attributes_metadata)
params.except!(*@user.user_synced_attributes_metadata.read_only_attributes) read_only = metadata.read_only_attributes
params.reject! { |key, _| read_only.include?(key.to_sym) }
end end
@user.assign_attributes(params) if params.any? @user.assign_attributes(params) if params.any?
......
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