diff options
Diffstat (limited to 'config/environment.rb')
-rw-r--r-- | config/environment.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/config/environment.rb b/config/environment.rb index 0af465049..d15ee9a0e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -6,7 +6,7 @@ # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') @@ -37,7 +37,11 @@ require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch') Rails::Initializer.run do |config| # Load intial mySociety config - MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true) + if ENV["RAILS_ENV"] == "test" + MySociety::Config.set_file(File.join(config.root_path, 'config', 'test'), true) + else + MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true) + end MySociety::Config.load_default # Settings in config/environments/* take precedence over those specified here @@ -119,14 +123,8 @@ if (MySociety::Config.get("DOMAIN", "") != "") end # fallback locale and available locales -if ENV["RAILS_ENV"] == "test" - # The tests assume that the "en" and "es" locales are available - available_locales = ["en", "es"] - default_locale = "en" -else - available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en es').split(/ /) - default_locale = MySociety::Config.get('DEFAULT_LOCALE', 'en') -end +available_locales = MySociety::Config.get('AVAILABLE_LOCALES', '').split(/ /) +default_locale = MySociety::Config.get('DEFAULT_LOCALE', '') FastGettext.default_available_locales = available_locales I18n.locale = default_locale @@ -134,6 +132,7 @@ I18n.available_locales = available_locales.map {|locale_name| locale_name.to_sym I18n.default_locale = default_locale # Load monkey patches and other things from lib/ +require 'ruby19.rb' require 'tmail_extensions.rb' require 'activesupport_cache_extensions.rb' require 'timezone_fixes.rb' |