BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
69e0b06d
Commit
69e0b06d
authored
Feb 27, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Issue Sorting] Add project scope when calculate maximum position[ci skip]
parent
1ff3cd99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
relative_positioning.rb
app/models/concerns/relative_positioning.rb
+4
-2
No files found.
app/models/concerns/relative_positioning.rb
View file @
69e0b06d
...
@@ -9,11 +9,11 @@ module RelativePositioning
...
@@ -9,11 +9,11 @@ module RelativePositioning
end
end
def
min_relative_position
def
min_relative_position
self
.
class
.
minimum
(
:relative_position
)
self
.
class
.
in_projects
(
project
.
id
).
minimum
(
:relative_position
)
end
end
def
max_relative_position
def
max_relative_position
self
.
class
.
maximum
(
:relative_position
)
self
.
class
.
in_projects
(
project
.
id
).
maximum
(
:relative_position
)
end
end
def
prev_relative_position
def
prev_relative_position
...
@@ -21,6 +21,7 @@ module RelativePositioning
...
@@ -21,6 +21,7 @@ module RelativePositioning
if
self
.
relative_position
if
self
.
relative_position
prev_pos
=
self
.
class
.
prev_pos
=
self
.
class
.
in_projects
(
project
.
id
).
where
(
'relative_position < ?'
,
self
.
relative_position
).
where
(
'relative_position < ?'
,
self
.
relative_position
).
maximum
(
:relative_position
)
maximum
(
:relative_position
)
end
end
...
@@ -33,6 +34,7 @@ module RelativePositioning
...
@@ -33,6 +34,7 @@ module RelativePositioning
if
self
.
relative_position
if
self
.
relative_position
next_pos
=
self
.
class
.
next_pos
=
self
.
class
.
in_projects
(
project
.
id
).
where
(
'relative_position > ?'
,
self
.
relative_position
).
where
(
'relative_position > ?'
,
self
.
relative_position
).
minimum
(
:relative_position
)
minimum
(
:relative_position
)
end
end
...
...
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