From 5ce4f607369c1adda5b1cb3ee5b512baccc6dacd Mon Sep 17 00:00:00 2001 From: Frederico Araujo Date: Thu, 19 Jan 2012 13:20:59 +0700 Subject: [PATCH] Added Fallback to use old hoptoad_api_key if not application.yml is not update --- config/application.yml.example | 4 ++-- config/initializers/airbreak.rb | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/application.yml.example b/config/application.yml.example index 60ba35d38..d3a97ade2 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -93,8 +93,8 @@ defaults: &defaults # Enable extensive logging to websocket server. socket_debug : false - # Airbreak api key, send failures to http://projectname.airbreak.io/ (Former Hoptoad) - airbreak_api_key: '' + # Airbrake api key, send failures to http://projectname.airbrake.io/ (Former Hoptoad) + airbrake_api_key: '' #social media setup facebook_app_id: '' diff --git a/config/initializers/airbreak.rb b/config/initializers/airbreak.rb index dd7a58e11..904db41d0 100644 --- a/config/initializers/airbreak.rb +++ b/config/initializers/airbreak.rb @@ -1,6 +1,13 @@ +# if old key still there, use it for new API, +# update application.yml to use airbrake_api_key instead # (Former Hoptoad) -if AppConfig[:airbreak_api_key].present? +if AppConfig[:airbrake_api_key].present? Airbrake.configure do |config| - config.api_key = AppConfig[:airbreak_api_key] + config.api_key = AppConfig[:airbrake_api_key] + end +elsif AppConfig[:hoptoad_api_key].present? + puts "You're using old hoptoad_api_key, please update application.yml to use airbrake_api_key instead." + Airbrake.configure do |config| + config.api_key = AppConfig[:hoptoad_api_key] end end