diff options
Diffstat (limited to 'config/environment.rb')
-rw-r--r-- | config/environment.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/environment.rb b/config/environment.rb index 606472740..91da156bb 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -28,6 +28,12 @@ load "config.rb" load "format.rb" load "debug_helpers.rb" load "util.rb" +# Patch Rails::GemDependency to cope with older versions of rubygems, e.g. in Debian Lenny +# Restores override removed in https://github.com/rails/rails/commit/c20a4d18e36a13b5eea3155beba36bb582c0cc87 +# without effecting method behaviour +# and adds fallback gem call removed in https://github.com/rails/rails/commit/4c3725723f15fab0a424cb1318b82b460714b72f +require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch') + Rails::Initializer.run do |config| # Load intial mySociety config @@ -103,7 +109,7 @@ ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN", # So that javascript assets use full URL, so proxied admin URLs read javascript OK if (MySociety::Config.get("DOMAIN", "") != "") ActionController::Base.asset_host = Proc.new { |source, request| - if request.fullpath.match(/^\/admin\//) + if ENV["RAILS_ENV"] != "test" && request.fullpath.match(/^\/admin\//) MySociety::Config.get("ADMIN_PUBLIC_URL", "") else MySociety::Config.get("DOMAIN", 'localhost:3000') |