From 0dece7929cf5b04f008640936fb3ece24ce80daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 1 Feb 2010 11:40:27 +0100 Subject: Deprecate AC configuration values which were moved to Rack. --- .../lib/action_controller/metal/compatibility.rb | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_controller/metal/compatibility.rb') diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 2be0fa097e..1d4a719aa6 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -15,9 +15,6 @@ module ActionController cattr_accessor :session_options self.session_options = {} - cattr_accessor :allow_concurrency - self.allow_concurrency = false - cattr_accessor :relative_url_root self.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT'] @@ -44,9 +41,6 @@ module ActionController self.page_cache_directory = defined?(Rails.public_path) ? Rails.public_path : "" - cattr_accessor :consider_all_requests_local - self.consider_all_requests_local = true - # Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets, # and images to a dedicated asset server away from the main web server. Example: # ActionController::Base.asset_host = "http://assets.example.com" @@ -74,6 +68,25 @@ module ActionController module ClassMethods def consider_all_requests_local + ActiveSupport::Deprecation.warn "ActionController::Base.consider_all_requests_local is deprecated, " << + "use Rails.application.config.consider_all_requests_local instead" + Rails.application.config.consider_all_requests_local + end + + def consider_all_requests_local=(value) + ActiveSupport::Deprecation.warn "ActionController::Base.consider_all_requests_local= is no longer effective. " << + "Please configure it on your application with config.consider_all_requests_local=" + end + + def allow_concurrency + ActiveSupport::Deprecation.warn "ActionController::Base.allow_concurrency is deprecated, " << + "use Rails.application.config.allow_concurrency instead" + Rails.application.config.allow_concurrency + end + + def allow_concurrency=(value) + ActiveSupport::Deprecation.warn "ActionController::Base.allow_concurrency= is no longer effective. " << + "Please configure it on your application with config.allow_concurrency=" end def rescue_action(env) @@ -86,6 +99,9 @@ module ActionController end end + delegate :consider_all_requests_local, :consider_all_requests_local=, + :allow_concurrency, :allow_concurrency=, :to => :"self.class" + def render_to_body(options) if options.is_a?(Hash) && options.key?(:template) options[:template].sub!(/^\//, '') -- cgit v1.2.3