This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix deprecation warning introduced in Rails 3.1.x

Somehow, the path manipulation on 3.1.x is not working on 3.0.x either. You've been warned.
  • Loading branch information...
1 parent e41c91b commit eb1858456b6b8046bd6c14e477ccf16c61c4b120 @sikachu sikachu committed Jun 8, 2011
Showing with 13 additions and 5 deletions.
  1. +13 −5 lib/diesel/testing/application.rb
@@ -7,11 +7,19 @@ module Testing
class Application < Rails::Application
config.encoding = "utf-8"
config.action_mailer.default_url_options = { :host => 'localhost' }
- config.paths.config.database = "#{APP_ROOT}/config/database.yml"
- config.paths.config.routes << "#{APP_ROOT}/config/routes.rb"
- config.paths.app.controllers << "#{APP_ROOT}/app/controllers"
- config.paths.app.views << "#{APP_ROOT}/app/views"
- config.paths.log = "tmp/log"
+ if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR >= 1
+ config.paths['config/database'] = "#{APP_ROOT}/config/database.yml"
+ config.paths['config/routes'] << "#{APP_ROOT}/config/routes.rb"
+ config.paths['app/controllers'] << "#{APP_ROOT}/app/controllers"
+ config.paths['app/views'] << "#{APP_ROOT}/app/views"
+ config.paths['log'] = "tmp/log/development.log"
+ else
+ config.paths.config.database = "#{APP_ROOT}/config/database.yml"
+ config.paths.config.routes << "#{APP_ROOT}/config/routes.rb"
+ config.paths.app.controllers << "#{APP_ROOT}/app/controllers"
+ config.paths.app.views << "#{APP_ROOT}/app/views"
+ config.paths.log = "tmp/log"
+ end
config.cache_classes = true
config.whiny_nils = true
config.consider_all_requests_local = true

0 comments on commit eb18584

Please sign in to comment.