Commit 096b2c53 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Remove unnecessary eagerloading

parent 169eaf0a
......@@ -24,18 +24,16 @@ module IssueLinks
private
def issues
return @issues if defined?(@issues)
referenced_issues = @issue.referenced_issues.select('issues.*', 'issue_links.id AS issue_links_id')
referred_by_issues = @issue.referred_by_issues.select('issues.*', 'issue_links.id AS issue_links_id')
authorized_issues = IssuesFinder.new(@current_user).execute
union = Gitlab::SQL::Union.new([referenced_issues, referred_by_issues])
@issues = Issue.from("(#{union.to_sql}) #{Issue.table_name}")
.where(id: authorized_issues.select(:id))
.preload(project: :namespace)
.reorder('issue_links_id')
Issue.from("(#{union.to_sql}) #{Issue.table_name}")
.where(id: authorized_issues.select(:id))
.preload(project: :namespace)
.reorder('issue_links_id')
end
def destroy_relation_path(issue)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment