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
4c8c5a0a
Commit
4c8c5a0a
authored
Apr 13, 2021
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not pass AR object to Arel quotes
parent
06dd3bcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+2
-2
No files found.
app/models/concerns/issuable.rb
View file @
4c8c5a0a
...
...
@@ -103,7 +103,7 @@ module Issuable
end
scope
:assigned_to
,
->
(
u
)
do
assignees_table
=
Arel
::
Table
.
new
(
"
#{
to_ability_name
}
_assignees"
)
sql
=
assignees_table
.
project
(
'true'
).
where
(
assignees_table
[
:user_id
].
in
(
u
)).
where
(
Arel
::
Nodes
::
SqlLiteral
.
new
(
"
#{
to_ability_name
}
_id =
#{
to_ability_name
}
s.id"
))
sql
=
assignees_table
.
project
(
'true'
).
where
(
assignees_table
[
:user_id
].
in
(
u
.
id
)).
where
(
Arel
::
Nodes
::
SqlLiteral
.
new
(
"
#{
to_ability_name
}
_id =
#{
to_ability_name
}
s.id"
))
where
(
"EXISTS (
#{
sql
.
to_sql
}
)"
)
end
# rubocop:enable GitlabSecurity/SqlInjection
...
...
app/models/merge_request.rb
View file @
4c8c5a0a
...
...
@@ -381,7 +381,7 @@ class MergeRequest < ApplicationRecord
scope
:review_requested_to
,
->
(
user
)
do
where
(
reviewers_subquery
.
where
(
Arel
::
Table
.
new
(
"
#{
to_ability_name
}
_reviewers"
)[
:user_id
].
eq
(
user
))
.
where
(
Arel
::
Table
.
new
(
"
#{
to_ability_name
}
_reviewers"
)[
:user_id
].
eq
(
user
.
id
))
.
exists
)
end
...
...
@@ -389,7 +389,7 @@ class MergeRequest < ApplicationRecord
scope
:no_review_requested_to
,
->
(
user
)
do
where
(
reviewers_subquery
.
where
(
Arel
::
Table
.
new
(
"
#{
to_ability_name
}
_reviewers"
)[
:user_id
].
eq
(
user
))
.
where
(
Arel
::
Table
.
new
(
"
#{
to_ability_name
}
_reviewers"
)[
:user_id
].
eq
(
user
.
id
))
.
exists
.
not
)
...
...
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