Refactor and remove #prepare_relation method

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65054
This commit is contained in:
Andreas Brandl 2019-07-27 16:59:35 +02:00
parent 988dc80585
commit b9af5066ea
No known key found for this signature in database
GPG Key ID: F25982B13FEE55DA
7 changed files with 6 additions and 18 deletions

View File

@ -10,12 +10,5 @@ module Projects
true
end
private
def prepare_relation(relation, id_param = :id)
# TODO: Refactor and remove this method (https://gitlab.com/gitlab-org/gitlab-ce/issues/65054)
relation
end
end
end

View File

@ -16,8 +16,7 @@ module Projects
private
def move_deploy_keys_projects
prepare_relation(non_existent_deploy_keys_projects)
.update_all(project_id: @project.id)
non_existent_deploy_keys_projects.update_all(project_id: @project.id)
end
# rubocop: disable CodeReuse/ActiveRecord

View File

@ -16,8 +16,7 @@ module Projects
private
def move_lfs_objects_projects
prepare_relation(non_existent_lfs_objects_projects)
.update_all(project_id: @project.lfs_storage_project.id)
non_existent_lfs_objects_projects.update_all(project_id: @project.lfs_storage_project.id)
end
def remove_remaining_lfs_objects_project

View File

@ -16,8 +16,7 @@ module Projects
private
def move_notification_settings
prepare_relation(non_existent_notifications)
.update_all(source_id: @project.id)
non_existent_notifications.update_all(source_id: @project.id)
end
# Remove remaining notification settings from source_project

View File

@ -21,8 +21,7 @@ module Projects
private
def move_project_authorizations
prepare_relation(non_existent_authorization, :user_id)
.update_all(project_id: @project.id)
non_existent_authorization.update_all(project_id: @project.id)
end
def remove_remaining_authorizations

View File

@ -20,8 +20,7 @@ module Projects
private
def move_group_links
prepare_relation(non_existent_group_links)
.update_all(project_id: @project.id)
non_existent_group_links.update_all(project_id: @project.id)
end
# Remove remaining project group links from source_project

View File

@ -20,7 +20,7 @@ module Projects
private
def move_project_members
prepare_relation(non_existent_members).update_all(source_id: @project.id)
non_existent_members.update_all(source_id: @project.id)
end
def remove_remaining_members