Added Fallback to use old hoptoad_api_key if not application.yml is not update

This commit is contained in:
Frederico Araujo 2012-01-19 13:20:59 +07:00
parent f4801651eb
commit 5ce4f60736
2 changed files with 11 additions and 4 deletions

View file

@ -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: ''

View file

@ -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