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
d1c45294
Commit
d1c45294
authored
Sep 09, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove need for SQL injection
parent
e01dd08e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
app/models/concerns/relative_positioning.rb
app/models/concerns/relative_positioning.rb
+5
-2
No files found.
app/models/concerns/relative_positioning.rb
View file @
d1c45294
...
...
@@ -69,8 +69,11 @@ module RelativePositioning
end
def
nextify
(
relation
,
gt
=
true
)
op
=
gt
?
'>'
:
'<'
relation
.
where
(
"relative_position
#{
op
}
?"
,
object
.
relative_position
)
if
gt
relation
.
where
(
"relative_position > ?"
,
relative_position
)
else
relation
.
where
(
"relative_position < ?"
,
relative_position
)
end
end
def
relative_siblings
(
relation
=
scoped_items
)
...
...
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