From d8b65b46672824959e6f96d2c7b51d289b268247 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 11 Aug 2014 10:44:26 -0300 Subject: [PATCH] Fix the use of exception notification --- Gemfile | 1 + Gemfile.lock | 4 ++++ config/initializers/exception_notification.rb | 12 ++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 4925011..51c3c7a 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,7 @@ gem 'hpricot' gem 'nokogiri' gem 'rake', :require => false gem 'rest-client' +gem 'exception_notification' # FIXME list here all actual dependencies (i.e. the ones in debian/control), # with their GEM names (not the Debian package names) diff --git a/Gemfile.lock b/Gemfile.lock index 52f835f..a585c84 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,6 +62,9 @@ GEM diff-lcs (1.1.3) erubis (2.7.0) eventmachine (0.12.10) + exception_notification (4.0.1) + actionmailer (>= 3.0.4) + activesupport (>= 3.0.4) fast_gettext (0.6.8) ffi (1.0.11) gherkin (2.4.21) @@ -167,6 +170,7 @@ DEPENDENCIES daemons dalli database_cleaner + exception_notification fast_gettext hpricot mocha diff --git a/config/initializers/exception_notification.rb b/config/initializers/exception_notification.rb index 471cfec..80ff466 100644 --- a/config/initializers/exception_notification.rb +++ b/config/initializers/exception_notification.rb @@ -1,8 +1,8 @@ unless NOOSFERO_CONF['exception_recipients'].blank? - require 'noosfero.rb' - require 'exception_notification.rb' - ExceptionNotifier.sender_address = "noreply@#{Noosfero.default_hostname}" - ExceptionNotifier.email_prefix = "[Noosfero ERROR] " - ExceptionNotifier.exception_recipients = NOOSFERO_CONF['exception_recipients'] - ActionController::Base.send :include, ExceptionNotifiable + Noosfero::Application.config.middleware.use ExceptionNotification::Rack, + :email => { + :sender_address => "noreply@#{Noosfero.default_hostname}", + :email_prefix => "[Noosfero ERROR] ", + :exception_recipients => NOOSFERO_CONF['exception_recipients'] + } end -- libgit2 0.21.2