Refactor and remove #prepare_relation method
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65054
This commit is contained in:
parent
988dc80585
commit
b9af5066ea
7 changed files with 6 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue