diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-08-31 20:16:34 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-10-19 12:57:20 +0300 |
commit | f3fba178b931cd2ba67f81ee667893cb84e7d42f (patch) | |
tree | 24c5a688880d5edd75642a7f16623124bde9fc22 /app/services/projects/forks_count_service.rb | |
parent | 4321d70d24a6a7dc99f80fa4211ba6250504d99b (diff) |
Remove the `ForkedProjectLink` model
This removes the `ForkedProjectLink` model that has been replaced by
the `ForkNetworkMember` and `ForkNetwork` combination. All existing
relations have been adjusted to use these new models.
The `forked_project_link` table has been dropped.
The "Forks" count on the admin dashboard has been updated to count all
`ForkNetworkMember` rows and deduct the number of `ForkNetwork`
rows. This is because now the "root-project" of a fork network also
has a `ForkNetworkMember` row. This count could become inaccurate when
the root of a fork network is deleted.
Diffstat (limited to 'app/services/projects/forks_count_service.rb')
-rw-r--r-- | app/services/projects/forks_count_service.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/services/projects/forks_count_service.rb b/app/services/projects/forks_count_service.rb index 00e73148358..ca85e2dc281 100644 --- a/app/services/projects/forks_count_service.rb +++ b/app/services/projects/forks_count_service.rb @@ -9,10 +9,7 @@ module Projects # rubocop: disable CodeReuse/ActiveRecord def self.query(project_ids) - # We can't directly change ForkedProjectLink to ForkNetworkMember here - # Nowadays, when a call using v3 to projects/:id/fork is made, - # the relationship to ForkNetworkMember is not updated - ForkedProjectLink.where(forked_from_project: project_ids) + ForkNetworkMember.where(forked_from_project: project_ids) end # rubocop: enable CodeReuse/ActiveRecord end |