Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c8d1ca7a
Commit
c8d1ca7a
authored
Dec 13, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation: Passing ActiveRecord::Base objects to sanitize_sql_hash_for_assignment
parent
07e079e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
app/services/labels/promote_service.rb
app/services/labels/promote_service.rb
+4
-4
changelogs/unreleased/deprecated-passing-activerecord-objects.yml
...gs/unreleased/deprecated-passing-activerecord-objects.yml
+5
-0
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+1
-1
No files found.
app/services/labels/promote_service.rb
View file @
c8d1ca7a
...
...
@@ -57,7 +57,7 @@ module Labels
def
update_issuables
(
new_label
,
label_ids
)
LabelLink
.
where
(
label:
label_ids
)
.
update_all
(
label_id:
new_label
)
.
update_all
(
label_id:
new_label
.
id
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
@@ -65,7 +65,7 @@ module Labels
def
update_resource_label_events
(
new_label
,
label_ids
)
ResourceLabelEvent
.
where
(
label:
label_ids
)
.
update_all
(
label_id:
new_label
)
.
update_all
(
label_id:
new_label
.
id
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
@@ -73,7 +73,7 @@ module Labels
def
update_issue_board_lists
(
new_label
,
label_ids
)
List
.
where
(
label:
label_ids
)
.
update_all
(
label_id:
new_label
)
.
update_all
(
label_id:
new_label
.
id
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
@@ -81,7 +81,7 @@ module Labels
def
update_priorities
(
new_label
,
label_ids
)
LabelPriority
.
where
(
label:
label_ids
)
.
update_all
(
label_id:
new_label
)
.
update_all
(
label_id:
new_label
.
id
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
changelogs/unreleased/deprecated-passing-activerecord-objects.yml
0 → 100644
View file @
c8d1ca7a
---
title
:
'
Fix
deprecation:
Passing
ActiveRecord::Base
objects
to
sanitize_sql_hash_for_assignment'
merge_request
:
23818
author
:
Jasper Maes
type
:
other
lib/api/commit_statuses.rb
View file @
c8d1ca7a
...
...
@@ -116,7 +116,7 @@ module API
end
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
rescue
StateMachines
::
InvalidTransition
=>
e
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment