Просмотр исходного кода

Fixed web server detection (skip self notifications).

Martin Edenhofer 9 лет назад
Родитель
Сommit
be2a050890
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 1
      app/models/observer/ticket/notification.rb
  2. 3 0
      config.ru

+ 1 - 1
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
 

+ 3 - 0
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