diff options
Diffstat (limited to 'config/environment.rb')
-rw-r--r-- | config/environment.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/config/environment.rb b/config/environment.rb index 77d212f2f..f268233c6 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.2' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') @@ -51,6 +51,8 @@ Rails::Initializer.run do |config| # config.log_level = :debug # # Specify gems that this application depends on and have them installed with rake gems:install + config.gem "locale", :version => '>=2.0.5' + config.gem "gettext", :version => '>=1.9.3' config.gem "fast_gettext", :version => '>=0.4.8' config.gem "rack", :version => '1.1.0' config.gem "recaptcha", :lib => "recaptcha/rails" @@ -63,7 +65,7 @@ Rails::Initializer.run do |config| # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. config.action_controller.session = { - :session_key => '_wdtk_cookie_session', + :key => '_wdtk_cookie_session', :secret => MySociety::Config.get("COOKIE_STORE_SESSION_SECRET", 'this default is insecure as code is open source, please override for live sites in config/general; this will do for local development') } config.action_controller.session_store = :cookie_store @@ -106,7 +108,7 @@ ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN", if (MySociety::Config.get("DOMAIN", "") != "") ActionController::Base.asset_host = Proc.new { |source, request| if request.fullpath.match(/^\/admin\//) - MySociety::Config.get("ADMIN_PUBLIC_URL", "/") + MySociety::Config.get("ADMIN_PUBLIC_URL", "") else MySociety::Config.get("DOMAIN", 'localhost:3000') end @@ -115,8 +117,13 @@ end # fallback locale and available locales I18n.default_locale = :sq -available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'sq en sr') -FastGettext.default_available_locales = available_locales.split(/ /) +if ENV["RAILS_ENV"] == "test" + # The tests assume that the "en" and "es" locales are available + FastGettext.default_available_locales = ["en", "es"] +else + available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'sq en sr') + FastGettext.default_available_locales = available_locales.split(/ /) +end # Load monkey patches and other things from lib/ require 'tmail_extensions.rb' |