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
...
@@ -24,18 +24,16 @@ module IssueLinks
private
private
def
issues
def
issues
authorized_issues
=
IssuesFinder
related_issues
=
Issue
.
new
(
@current_user
,
feature_availability_check:
false
)
.
select
([
'issues.*'
,
'issue_links.id AS issue_links_id'
])
.
execute
.
joins
(
"INNER JOIN issue_links ON
.
reorder
(
nil
)
(issue_links.source_id = issues.id AND issue_links.target_id =
#{
@issue
.
id
}
)
OR
Issue
.
from
(
"(SELECT issues.*, issue_links.id AS issue_links_id
(issue_links.target_id = issues.id AND issue_links.source_id =
#{
@issue
.
id
}
)"
)
FROM issue_links, issues
.
preload
(
project: :namespace
)
WHERE (issue_links.source_id = issues.id AND issue_links.target_id =
#{
@issue
.
id
}
)
.
reorder
(
'issue_links_id'
)
OR (issue_links.target_id = issues.id AND issue_links.source_id =
#{
@issue
.
id
}
))
#{
Issue
.
table_name
}
"
)
.
where
(
id:
authorized_issues
.
select
(
:id
))
Ability
.
issues_readable_by_user
(
related_issues
,
@current_user
)
.
preload
(
project: :namespace
)
.
reorder
(
:issue_links_id
)
end
end
def
destroy_relation_path
(
issue
)
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