Skip to content

Commit

Permalink
[api] make sure we can call innocent rake tasks without mysql
Browse files Browse the repository at this point in the history
e.g. checking code
  • Loading branch information
coolo committed Oct 22, 2013
1 parent 736f42f commit e8b38d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/api/config/initializers/hoptoad.rb
@@ -1,8 +1,14 @@
HoptoadNotifier.configure do |config|
# Change this to some sensible data for your errbit instance
config.api_key = CONFIG['errbit_api_key'] || 'YOUR_ERRBIT_API_KEY'
config.host = Configuration.errbit_url || 'YOUR_ERRBIT_HOST'
if CONFIG['errbit_api_key'].blank? || Configuration.errbit_url.blank?
begin
errbit_url = Configuration.errbit_url
rescue Mysql2::Error
# no mysql, no exceptions - useful for rake tasks
errbit_url = nil
end
config.host = errbit_url || 'YOUR_ERRBIT_HOST'
if CONFIG['errbit_api_key'].blank? || errbit_url.blank?
config.development_environments = "production development test"
else
config.development_environments = "development test"
Expand Down
1 change: 1 addition & 0 deletions src/api/config/initializers/wrap_parameters.rb
Expand Up @@ -5,6 +5,7 @@
require 'active_support/core_ext/hash/conversions'
require 'action_dispatch/http/request'
require 'active_support/core_ext/hash/indifferent_access'
require 'api_exception'

# Disable all default rails parameter parsing

Expand Down

0 comments on commit e8b38d8

Please sign in to comment.