diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-03 17:06:09 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-07 11:46:23 +0200 |
commit | f90b27da7777b0c72782d2a930f770e2f27757e2 (patch) | |
tree | 50f1d5b84e40c45c29a1be2b8150029da7db2d87 /app/models/namespace.rb | |
parent | 8160550439d2027c12d5556c8ce1f8afd250628a (diff) | |
download | gitlab-ce-f90b27da7777b0c72782d2a930f770e2f27757e2.tar.gz |
Find forks within users/namespaces using fork memberships
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index e279d8dd8c5..4672881e220 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -139,7 +139,9 @@ class Namespace < ActiveRecord::Base end def find_fork_of(project) - projects.joins(:forked_project_link).find_by('forked_project_links.forked_from_project_id = ?', project.id) + return nil unless project.fork_network + + project.fork_network.find_forks_in(projects).first end def lfs_enabled? |