summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-03-02 18:18:50 -0500
committerRobert Speicher <rspeicher@gmail.com>2017-03-02 20:29:30 -0500
commita0ab45d0c3d9625e8cff994173b6441e9623770f (patch)
tree2f10dda3545b535a085ba7de8ad237bf5c74b997 /lib
parent12592ac7f4ae8ee8d074079b37940d5cbd91eb6a (diff)
downloadgitlab-ce-a0ab45d0c3d9625e8cff994173b6441e9623770f.tar.gz
Fix the `Gitlab::Seeder` monkey patch to disable mail deliveryrs-dev-seed-time
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/seeder.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/gitlab/seeder.rb b/lib/gitlab/seeder.rb
index b7f825e8284..823f697f51c 100644
--- a/lib/gitlab/seeder.rb
+++ b/lib/gitlab/seeder.rb
@@ -1,24 +1,23 @@
+module DeliverNever
+ def deliver_later
+ self
+ end
+end
+
module Gitlab
class Seeder
def self.quiet
mute_mailer
SeedFu.quiet = true
+
yield
+
SeedFu.quiet = false
puts "\nOK".color(:green)
end
- def self.by_user(user)
- yield
- end
-
def self.mute_mailer
- code = <<-eos
-def Notify.deliver_later
- self
-end
- eos
- eval(code) # rubocop:disable Security/Eval
+ ActionMailer::MessageDelivery.prepend(DeliverNever)
end
end
end