Skip to content

Commit

Permalink
Default to test mode in test or development.
Browse files Browse the repository at this point in the history
Unless configured otherwise, Rakismet will default to being in test mode
when the current `Rails.env` is `test` or `development`. Of course any
explicit configuration via `Rakismet.test = true|false` will override
this default.
  • Loading branch information
stevenharman authored and joshfrench committed Jul 20, 2012
1 parent 1a2f4b4 commit 097a891
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/rakismet/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Railtie < Rails::Railtie
Rakismet.host = app.config.rakismet[:host]
Rakismet.proxy_host = app.config.rakismet[:proxy_host]
Rakismet.proxy_port = app.config.rakismet[:proxy_port]
Rakismet.test = app.config.rakismet.fetch(:test) { Rails.env.test? || Rails.env.development? }
app.middleware.use Rakismet::Middleware if app.config.rakismet.use_middleware
end

Expand Down

0 comments on commit 097a891

Please sign in to comment.