diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-18 09:08:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-18 09:08:27 +0300 |
commit | 6e2c0f81afd4c57aba26bc273ad6fdcd6ec19e27 (patch) | |
tree | 390493392c61792b4938d587b21d0c93903a98de /app/controllers/projects | |
parent | 1a683ed158e0d1b37b35cc24e219e57a1719642b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index ff3dc71b6cc..de2040afff3 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -65,9 +65,8 @@ class Projects::ForksController < Projects::ApplicationController end end - # rubocop: disable CodeReuse/ActiveRecord def create - @forked_project = fork_namespace.projects.find_by(path: project.path) + @forked_project = fork_namespace.projects.find_by(path: project.path) # rubocop: disable CodeReuse/ActiveRecord @forked_project = nil unless @forked_project && @forked_project.forked_from_project == project @forked_project ||= fork_service.execute @@ -96,7 +95,9 @@ class Projects::ForksController < Projects::ApplicationController current_user: current_user ).execute + # rubocop: disable CodeReuse/ActiveRecord forks.includes(:route, :creator, :group, :topics, namespace: [:route, :owner]) + # rubocop: enable CodeReuse/ActiveRecord end def fork_service @@ -130,15 +131,21 @@ class Projects::ForksController < Projects::ApplicationController end def load_namespaces_with_associations + # rubocop: disable CodeReuse/ActiveRecord @load_namespaces_with_associations ||= fork_service.valid_fork_targets(only_groups: true).preload(:route) + # rubocop: enable CodeReuse/ActiveRecord end def memberships_hash + # rubocop: disable CodeReuse/ActiveRecord current_user.members.where(source: load_namespaces_with_associations).index_by(&:source_id) + # rubocop: enable CodeReuse/ActiveRecord end def forked_projects_by_namespace(namespaces) + # rubocop: disable CodeReuse/ActiveRecord project.forks.where(namespace: namespaces).includes(:namespace).index_by(&:namespace_id) + # rubocop: enable CodeReuse/ActiveRecord end end |