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
0e2f1829
Commit
0e2f1829
authored
Jun 06, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use INNER JOIN + Ability.issues_readable_by_user on IssueLinks::ListService
parent
56016b7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
app/services/issue_links/list_service.rb
app/services/issue_links/list_service.rb
+10
-12
No files found.
app/services/issue_links/list_service.rb
View file @
0e2f1829
...
...
@@ -24,18 +24,16 @@ module IssueLinks
private
def
issues
authorized_issues
=
IssuesFinder
.
new
(
@current_user
,
feature_availability_check:
false
)
.
execute
.
reorder
(
nil
)
Issue
.
from
(
"(SELECT issues.*, issue_links.id AS issue_links_id
FROM issue_links, issues
WHERE (issue_links.source_id = issues.id AND issue_links.target_id =
#{
@issue
.
id
}
)
OR (issue_links.target_id = issues.id AND issue_links.source_id =
#{
@issue
.
id
}
))
#{
Issue
.
table_name
}
"
)
.
where
(
id:
authorized_issues
.
select
(
:id
))
.
preload
(
project: :namespace
)
.
reorder
(
:issue_links_id
)
related_issues
=
Issue
.
select
([
'issues.*'
,
'issue_links.id AS issue_links_id'
])
.
joins
(
"INNER JOIN issue_links ON
(issue_links.source_id = issues.id AND issue_links.target_id =
#{
@issue
.
id
}
)
OR
(issue_links.target_id = issues.id AND issue_links.source_id =
#{
@issue
.
id
}
)"
)
.
preload
(
project: :namespace
)
.
reorder
(
'issue_links_id'
)
Ability
.
issues_readable_by_user
(
related_issues
,
@current_user
)
end
def
destroy_relation_path
(
issue
)
...
...
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