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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1fef5a04
Commit
1fef5a04
authored
Jun 22, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve app/models/milestone.rb
parent
7f6a5b6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
35 deletions
+0
-35
app/models/milestone.rb
app/models/milestone.rb
+0
-35
No files found.
app/models/milestone.rb
View file @
1fef5a04
...
...
@@ -166,41 +166,6 @@ class Milestone < ActiveRecord::Base
write_attribute
(
:title
,
sanitize_title
(
value
))
if
value
.
present?
end
<<<<<<<
HEAD
=======
# Sorts the issues for the given IDs.
#
# This method runs a single SQL query using a CASE statement to update the
# position of all issues in the current milestone (scoped to the list of IDs).
#
# Given the ids [10, 20, 30] this method produces a SQL query something like
# the following:
#
# UPDATE issues
# SET position = CASE
# WHEN id = 10 THEN 1
# WHEN id = 20 THEN 2
# WHEN id = 30 THEN 3
# ELSE position
# END
# WHERE id IN (10, 20, 30);
#
# This method expects that the IDs given in `ids` are already Fixnums.
def
sort_issues
(
ids
)
pairs
=
[]
ids
.
each_with_index
do
|
id
,
index
|
pairs
<<
id
pairs
<<
index
+
1
end
conditions
=
'WHEN id = ? THEN ? '
*
ids
.
length
issues
.
where
(
id:
ids
)
.
update_all
([
"position = CASE
#{
conditions
}
ELSE position END"
,
*
pairs
])
end
>>>>>>>
03554
88
d4ac038c793dad96da2506b218b44f4a6
private
def
milestone_format_reference
(
format
=
:iid
)
...
...
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