diff options
Diffstat (limited to 'railties/lib/rails/application/configuration.rb')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 086fd5ed95..31fc80e544 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -5,7 +5,7 @@ require 'rails/engine/configuration' module Rails class Application class Configuration < ::Rails::Engine::Configuration - attr_accessor :asset_host, :assets, :autoflush_log, + attr_accessor :allow_concurrency, :asset_host, :assets, :autoflush_log, :cache_classes, :cache_store, :consider_all_requests_local, :console, :eager_load, :exceptions_app, :file_watcher, :filter_parameters, :force_ssl, :helpers_paths, :logger, :log_formatter, :log_tags, @@ -20,6 +20,7 @@ module Rails def initialize(*) super self.encoding = "utf-8" + @allow_concurrency = nil @consider_all_requests_local = false @filter_parameters = [] @filter_redirect = [] @@ -48,12 +49,12 @@ module Rails @secret_key_base = nil @assets = ActiveSupport::OrderedOptions.new - @assets.enabled = false + @assets.enabled = true @assets.paths = [] @assets.precompile = [ Proc.new { |path, fn| fn =~ /app\/assets/ && !%w(.js .css).include?(File.extname(path)) }, /(?:\/|\\|\A)application\.(css|js)$/ ] @assets.prefix = "/assets" - @assets.version = '' + @assets.version = '1.0' @assets.debug = false @assets.compile = true @assets.digest = false @@ -97,12 +98,17 @@ module Rails self end - # Loads and returns the contents of the #database_configuration_file. The - # contents of the file are processed via ERB before being sent through - # YAML::load. + # Loads and returns the configuration of the database. def database_configuration - require 'erb' - YAML.load ERB.new(IO.read(paths["config/database"].first)).result + yaml = paths["config/database"].first + if File.exists?(yaml) + require "erb" + YAML.load ERB.new(IO.read(yaml)).result + elsif ENV['DATABASE_URL'] + nil + else + raise "Could not load database configuration. No such file - #{yaml}" + end rescue Psych::SyntaxError => e raise "YAML syntax error occurred while parsing #{paths["config/database"].first}. " \ "Please note that YAML must be consistently indented using spaces. Tabs are not allowed. " \ |