From e8785ded1e922a72989614d7e70e9c26c367f1aa Mon Sep 17 00:00:00 2001
From: Robert Speicher <rspeicher@gmail.com>
Date: Fri, 15 Jan 2016 17:47:28 -0500
Subject: [PATCH] Prevent StateMachine warnings from outputting during a cron
 task

[ci skip]

Closes #5931
---
 lib/tasks/gitlab/task_helpers.rake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/tasks/gitlab/task_helpers.rake b/lib/tasks/gitlab/task_helpers.rake
index 8c63877e51..d33b5b31e1 100644
--- a/lib/tasks/gitlab/task_helpers.rake
+++ b/lib/tasks/gitlab/task_helpers.rake
@@ -4,6 +4,9 @@ end
 
 String.disable_colorization = true unless STDOUT.isatty
 
+# Prevent StateMachine warnings from outputting during a cron task
+StateMachines::Machine.ignore_method_conflicts = true if ENV['CRON']
+
 namespace :gitlab do
 
   # Ask if the user wants to continue
-- 
2.30.9