Commit dc15abaa authored by mhasbini's avatar mhasbini

Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery

parent 26ba13f2
...@@ -635,8 +635,10 @@ class User < ActiveRecord::Base ...@@ -635,8 +635,10 @@ class User < ActiveRecord::Base
end end
def fork_of(project) 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? if links.any?
links.first.forked_to_project links.first.forked_to_project
else else
......
---
title: Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery
merge_request:
author: mhasbini
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