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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
a0ab45d0
Commit
a0ab45d0
authored
Mar 02, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the `Gitlab::Seeder` monkey patch to disable mail delivery
parent
12592ac7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
db/fixtures/development/13_comments.rb
db/fixtures/development/13_comments.rb
+2
-2
lib/gitlab/seeder.rb
lib/gitlab/seeder.rb
+9
-10
No files found.
db/fixtures/development/13_comments.rb
View file @
a0ab45d0
require
'./spec/support/sidekiq'
require
'./spec/support/sidekiq'
Gitlab
::
Seeder
.
quiet
do
Gitlab
::
Seeder
.
quiet
do
Issue
.
all
.
each
do
|
issue
|
Issue
.
find_
each
do
|
issue
|
project
=
issue
.
project
project
=
issue
.
project
project
.
team
.
users
.
each
do
|
user
|
project
.
team
.
users
.
each
do
|
user
|
...
@@ -16,7 +16,7 @@ Gitlab::Seeder.quiet do
...
@@ -16,7 +16,7 @@ Gitlab::Seeder.quiet do
end
end
end
end
MergeRequest
.
all
.
each
do
|
mr
|
MergeRequest
.
find_
each
do
|
mr
|
project
=
mr
.
project
project
=
mr
.
project
project
.
team
.
users
.
each
do
|
user
|
project
.
team
.
users
.
each
do
|
user
|
...
...
lib/gitlab/seeder.rb
View file @
a0ab45d0
module
DeliverNever
def
deliver_later
self
end
end
module
Gitlab
module
Gitlab
class
Seeder
class
Seeder
def
self
.
quiet
def
self
.
quiet
mute_mailer
mute_mailer
SeedFu
.
quiet
=
true
SeedFu
.
quiet
=
true
yield
yield
SeedFu
.
quiet
=
false
SeedFu
.
quiet
=
false
puts
"
\n
OK"
.
color
(
:green
)
puts
"
\n
OK"
.
color
(
:green
)
end
end
def
self
.
by_user
(
user
)
yield
end
def
self
.
mute_mailer
def
self
.
mute_mailer
code
=
<<-
eos
ActionMailer
::
MessageDelivery
.
prepend
(
DeliverNever
)
def Notify.deliver_later
self
end
eos
eval
(
code
)
# rubocop:disable Security/Eval
end
end
end
end
end
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