From 8aafd56482c734d849910c7bb51c87e77aac5efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 25 Jan 2012 00:28:28 +0100 Subject: [PATCH] finally found a way to disable airbrake [ci skip] --- config/initializers/airbrake.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb index 920032308..5d7a680f8 100644 --- a/config/initializers/airbrake.rb +++ b/config/initializers/airbrake.rb @@ -2,10 +2,11 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -if AppConfig[:airbrake_api_key].present? - require 'airbrake' - Airbrake.configure do |config| - puts AppConfig[:airbrake_api_key] - config.api_key = AppConfig[:airbrake_api_key] +Airbrake.configure do |config| + if AppConfig[:airbrake_api_key].present? + config.api_key = AppConfig[:airbrake_api_key] + else + # creative way to disable Airbrake, should be replaced once the gem provides a proper way + config.development_environments << Rails.env end -end \ No newline at end of file +end