Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery
This commit is contained in:
parent
26ba13f203
commit
dc15abaa22
|
@ -635,8 +635,10 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def fork_of(project)
|
||||
links = ForkedProjectLink.where(forked_from_project_id: project, forked_to_project_id: personal_projects)
|
||||
|
||||
links = ForkedProjectLink.where(
|
||||
forked_from_project_id: project,
|
||||
forked_to_project_id: personal_projects.unscope(:order)
|
||||
)
|
||||
if links.any?
|
||||
links.first.forked_to_project
|
||||
else
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery
|
||||
merge_request:
|
||||
author: mhasbini
|
Loading…
Reference in New Issue