BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
065d4453
Unverified
Commit
065d4453
authored
May 07, 2018
by
Olivier Gonzalez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanly handle plural name for ghost user migration
parent
0eb74426
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
migrate_to_ghost_user_service.rb
app/services/users/migrate_to_ghost_user_service.rb
+2
-2
migrate_to_ghost_user_service_shared_examples.rb
...services/migrate_to_ghost_user_service_shared_examples.rb
+1
-1
No files found.
app/services/users/migrate_to_ghost_user_service.rb
View file @
065d4453
...
...
@@ -49,7 +49,7 @@ module Users
migrate_merge_requests
migrate_notes
migrate_abuse_reports
migrate_award_emoji
s
migrate_award_emoji
end
def
migrate_issues
...
...
@@ -70,7 +70,7 @@ module Users
user
.
reported_abuse_reports
.
update_all
(
reporter_id:
ghost_user
.
id
)
end
def
migrate_award_emoji
s
def
migrate_award_emoji
user
.
award_emoji
.
update_all
(
user_id:
ghost_user
.
id
)
end
end
...
...
spec/support/services/migrate_to_ghost_user_service_shared_examples.rb
View file @
065d4453
...
...
@@ -86,7 +86,7 @@ shared_examples "migrating a deleted user's associated records to the ghost user
end
it
"blocks the user before
#{
record_class_name
}
migration begins"
do
expect
(
service
).
to
receive
(
"migrate_
#{
record_class_name
.
parameterize
(
'_'
)
}
s
"
.
to_sym
)
do
expect
(
service
).
to
receive
(
"migrate_
#{
record_class_name
.
parameterize
(
'_'
)
.
pluralize
}
"
.
to_sym
)
do
expect
(
user
.
reload
).
to
be_blocked
end
...
...
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