From be2a0508901202deb14b7005b818dbf30fb45919 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 4 Feb 2016 12:39:05 +0100 Subject: [PATCH] Fixed web server detection (skip self notifications). --- app/models/observer/ticket/notification.rb | 2 +- config.ru | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/observer/ticket/notification.rb b/app/models/observer/ticket/notification.rb index de50d994c..3f06a4b06 100644 --- a/app/models/observer/ticket/notification.rb +++ b/app/models/observer/ticket/notification.rb @@ -18,7 +18,7 @@ class Observer::Ticket::Notification < ActiveRecord::Observer EventBuffer.reset via_web = false - if ENV['SERVER_NAME'] + if ENV['RACK_ENV'] || defined? Rails.configuration.webserver_is_active via_web = true end diff --git a/config.ru b/config.ru index de582f9b0..f742ce24f 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,7 @@ # This file is used by Rack-based servers to start the application. +# set config to do no self notification +Rails.configuration.webserver_is_active = true + require ::File.expand_path('../config/environment', __FILE__) run Zammad::Application