diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-03 10:45:33 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-03-03 10:45:33 +0000 |
commit | 4f44717d386582622504669097f536ab0e8936e5 (patch) | |
tree | 06d575d89a28d20d37fb3673c194e916c88b6099 | |
parent | 320ef318f874e15fd5d16e2da6374e8e82abd2b2 (diff) | |
parent | a0ab45d0c3d9625e8cff994173b6441e9623770f (diff) | |
download | gitlab-ce-4f44717d386582622504669097f536ab0e8936e5.tar.gz |
Merge branch 'rs-dev-seed-time' into 'master'
Fix the `Gitlab::Seeder` monkey patch to disable mail delivery
Closes #27609
See merge request !9678
-rw-r--r-- | db/fixtures/development/13_comments.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/seeder.rb | 19 |
2 files changed, 11 insertions, 12 deletions
diff --git a/db/fixtures/development/13_comments.rb b/db/fixtures/development/13_comments.rb index 29b8081055d..bc2d74c8034 100644 --- a/db/fixtures/development/13_comments.rb +++ b/db/fixtures/development/13_comments.rb @@ -1,7 +1,7 @@ require './spec/support/sidekiq' Gitlab::Seeder.quiet do - Issue.all.each do |issue| + Issue.find_each do |issue| project = issue.project project.team.users.each do |user| @@ -16,7 +16,7 @@ Gitlab::Seeder.quiet do end end - MergeRequest.all.each do |mr| + MergeRequest.find_each do |mr| project = mr.project project.team.users.each do |user| 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 |