This repository has been archived by the owner on Nov 11, 2017. It is now read-only.
/
application.rb
44 lines (39 loc) · 1.59 KB
/
application.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'rails/all'
module Diesel
module Testing
APP_ROOT = File.expand_path('..', __FILE__).freeze
class Application < Rails::Application
config.encoding = "utf-8"
config.action_mailer.default_url_options = { :host => 'localhost' }
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
config.action_controller.perform_caching = false
config.action_dispatch.show_exceptions = false
config.action_controller.allow_forgery_protection = false
config.action_mailer.delivery_method = :test
config.active_support.deprecation = :stderr
config.secret_token = "DIESEL" * 5 # so diesel
def require_environment!
initialize!
end
def initialize!
FileUtils.mkdir_p(Rails.root.join("db").to_s)
super unless @initialized
end
end
end
end