Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b9af5066
Commit
b9af5066
authored
Jul 27, 2019
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor and remove #prepare_relation method
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/65054
parent
988dc805
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
6 additions
and
18 deletions
+6
-18
app/services/projects/base_move_relations_service.rb
app/services/projects/base_move_relations_service.rb
+0
-7
app/services/projects/move_deploy_keys_projects_service.rb
app/services/projects/move_deploy_keys_projects_service.rb
+1
-2
app/services/projects/move_lfs_objects_projects_service.rb
app/services/projects/move_lfs_objects_projects_service.rb
+1
-2
app/services/projects/move_notification_settings_service.rb
app/services/projects/move_notification_settings_service.rb
+1
-2
app/services/projects/move_project_authorizations_service.rb
app/services/projects/move_project_authorizations_service.rb
+1
-2
app/services/projects/move_project_group_links_service.rb
app/services/projects/move_project_group_links_service.rb
+1
-2
app/services/projects/move_project_members_service.rb
app/services/projects/move_project_members_service.rb
+1
-1
No files found.
app/services/projects/base_move_relations_service.rb
View file @
b9af5066
...
@@ -10,12 +10,5 @@ module Projects
...
@@ -10,12 +10,5 @@ module Projects
true
true
end
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
end
end
app/services/projects/move_deploy_keys_projects_service.rb
View file @
b9af5066
...
@@ -16,8 +16,7 @@ module Projects
...
@@ -16,8 +16,7 @@ module Projects
private
private
def
move_deploy_keys_projects
def
move_deploy_keys_projects
prepare_relation
(
non_existent_deploy_keys_projects
)
non_existent_deploy_keys_projects
.
update_all
(
project_id:
@project
.
id
)
.
update_all
(
project_id:
@project
.
id
)
end
end
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
...
...
app/services/projects/move_lfs_objects_projects_service.rb
View file @
b9af5066
...
@@ -16,8 +16,7 @@ module Projects
...
@@ -16,8 +16,7 @@ module Projects
private
private
def
move_lfs_objects_projects
def
move_lfs_objects_projects
prepare_relation
(
non_existent_lfs_objects_projects
)
non_existent_lfs_objects_projects
.
update_all
(
project_id:
@project
.
lfs_storage_project
.
id
)
.
update_all
(
project_id:
@project
.
lfs_storage_project
.
id
)
end
end
def
remove_remaining_lfs_objects_project
def
remove_remaining_lfs_objects_project
...
...
app/services/projects/move_notification_settings_service.rb
View file @
b9af5066
...
@@ -16,8 +16,7 @@ module Projects
...
@@ -16,8 +16,7 @@ module Projects
private
private
def
move_notification_settings
def
move_notification_settings
prepare_relation
(
non_existent_notifications
)
non_existent_notifications
.
update_all
(
source_id:
@project
.
id
)
.
update_all
(
source_id:
@project
.
id
)
end
end
# Remove remaining notification settings from source_project
# Remove remaining notification settings from source_project
...
...
app/services/projects/move_project_authorizations_service.rb
View file @
b9af5066
...
@@ -21,8 +21,7 @@ module Projects
...
@@ -21,8 +21,7 @@ module Projects
private
private
def
move_project_authorizations
def
move_project_authorizations
prepare_relation
(
non_existent_authorization
,
:user_id
)
non_existent_authorization
.
update_all
(
project_id:
@project
.
id
)
.
update_all
(
project_id:
@project
.
id
)
end
end
def
remove_remaining_authorizations
def
remove_remaining_authorizations
...
...
app/services/projects/move_project_group_links_service.rb
View file @
b9af5066
...
@@ -20,8 +20,7 @@ module Projects
...
@@ -20,8 +20,7 @@ module Projects
private
private
def
move_group_links
def
move_group_links
prepare_relation
(
non_existent_group_links
)
non_existent_group_links
.
update_all
(
project_id:
@project
.
id
)
.
update_all
(
project_id:
@project
.
id
)
end
end
# Remove remaining project group links from source_project
# Remove remaining project group links from source_project
...
...
app/services/projects/move_project_members_service.rb
View file @
b9af5066
...
@@ -20,7 +20,7 @@ module Projects
...
@@ -20,7 +20,7 @@ module Projects
private
private
def
move_project_members
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
end
def
remove_remaining_members
def
remove_remaining_members
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment