Commit 4f10493b authored by Stan Hu's avatar Stan Hu

Merge branch 'deprecated-passing-activerecord-objects' into 'master'

Fix deprecation: Passing ActiveRecord::Base objects to sanitize_sql_hash_for_assignment

See merge request gitlab-org/gitlab-ce!23818
parents 30d2a3e6 c8d1ca7a
...@@ -57,7 +57,7 @@ module Labels ...@@ -57,7 +57,7 @@ module Labels
def update_issuables(new_label, label_ids) def update_issuables(new_label, label_ids)
LabelLink LabelLink
.where(label: label_ids) .where(label: label_ids)
.update_all(label_id: new_label) .update_all(label_id: new_label.id)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
...@@ -65,7 +65,7 @@ module Labels ...@@ -65,7 +65,7 @@ module Labels
def update_resource_label_events(new_label, label_ids) def update_resource_label_events(new_label, label_ids)
ResourceLabelEvent ResourceLabelEvent
.where(label: label_ids) .where(label: label_ids)
.update_all(label_id: new_label) .update_all(label_id: new_label.id)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
...@@ -73,7 +73,7 @@ module Labels ...@@ -73,7 +73,7 @@ module Labels
def update_issue_board_lists(new_label, label_ids) def update_issue_board_lists(new_label, label_ids)
List List
.where(label: label_ids) .where(label: label_ids)
.update_all(label_id: new_label) .update_all(label_id: new_label.id)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
...@@ -81,7 +81,7 @@ module Labels ...@@ -81,7 +81,7 @@ module Labels
def update_priorities(new_label, label_ids) def update_priorities(new_label, label_ids)
LabelPriority LabelPriority
.where(label: label_ids) .where(label: label_ids)
.update_all(label_id: new_label) .update_all(label_id: new_label.id)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
---
title: 'Fix deprecation: Passing ActiveRecord::Base objects to sanitize_sql_hash_for_assignment'
merge_request: 23818
author: Jasper Maes
type: other
...@@ -116,7 +116,7 @@ module API ...@@ -116,7 +116,7 @@ module API
end end
MergeRequest.where(source_project: @project, source_branch: ref) MergeRequest.where(source_project: @project, source_branch: ref)
.update_all(head_pipeline_id: pipeline) if pipeline.latest? .update_all(head_pipeline_id: pipeline.id) if pipeline.latest?
present status, with: Entities::CommitStatus present status, with: Entities::CommitStatus
rescue StateMachines::InvalidTransition => e rescue StateMachines::InvalidTransition => e
......
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