diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-01 11:40:27 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-01 11:40:27 +0100 |
commit | 0dece7929cf5b04f008640936fb3ece24ce80daa (patch) | |
tree | 4e21b6c9c1e89a80a0f91e3ef27334755a6d26e7 /actionpack/lib/action_controller/metal/compatibility.rb | |
parent | a8c5d22c230ae46f410eed68c9b63ed31379ebbf (diff) | |
download | rails-0dece7929cf5b04f008640936fb3ece24ce80daa.tar.gz rails-0dece7929cf5b04f008640936fb3ece24ce80daa.tar.bz2 rails-0dece7929cf5b04f008640936fb3ece24ce80daa.zip |
Deprecate AC configuration values which were moved to Rack.
Diffstat (limited to 'actionpack/lib/action_controller/metal/compatibility.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/compatibility.rb | 28 |
1 files changed, 22 insertions, 6 deletions
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!(/^\//, '') |