From 222722175402b38f9eacd110fcb037cc51410f1d Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 2 Nov 2008 13:03:14 +0100 Subject: [PATCH] Set the default from the ENV value when the file is required, not at runtime --- actionpack/lib/action_controller/base.rb | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index cf86c5e..0cf74cd 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -364,11 +364,8 @@ module ActionController #:nodoc: # If you are deploying to a subdirectory, you will need to set # config.action_controller.relative_url_root # This defaults to ENV['RAILS_RELATIVE_URL_ROOT'] - cattr_writer :relative_url_root - - def self.relative_url_root - @@relative_url_root || ENV['RAILS_RELATIVE_URL_ROOT'] - end + cattr_accessor :relative_url_root + self.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT'] # Holds the request object that's primarily used to get environment variables through access like # request.env["REQUEST_URI"]. -- 1.6.0.1 From a29f091e95a6baf052684017f4d6e05b4e3584bd Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 2 Nov 2008 13:10:03 +0100 Subject: [PATCH] Make the old deprecated name still set the values --- actionpack/lib/action_controller/request.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 9f33cbc..a6d4abf 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -9,10 +9,11 @@ module ActionController class AbstractRequest extend ActiveSupport::Memoizable - def self.relative_url_root=(*args) + def self.relative_url_root=(relative_url_root) ActiveSupport::Deprecation.warn( "ActionController::AbstractRequest.relative_url_root= has been renamed." + "You can now set it with config.action_controller.relative_url_root=", caller) + ActionController::base.relative_url_root=relative_url_root end HTTP_METHODS = %w(get head put post delete options) -- 1.6.0.1