diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-17 12:10:39 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-17 12:10:39 -0800 |
commit | 2f52bd308244b3f6e23ccb7c9a6336529fa9852a (patch) | |
tree | 272a80b71d7236ce3d0f81c1e37e18b8da600c1b /actionpack/lib/action_controller/metal | |
parent | 57f73a6bcf3311262172f1f348a1be614596b41a (diff) | |
parent | ed0f0ad35c62a4c1951d7da68c4793a5e35ba6ee (diff) | |
download | rails-2f52bd308244b3f6e23ccb7c9a6336529fa9852a.tar.gz rails-2f52bd308244b3f6e23ccb7c9a6336529fa9852a.tar.bz2 rails-2f52bd308244b3f6e23ccb7c9a6336529fa9852a.zip |
Merge pull request #4498 from carlosantoniodasilva/action-controller-refactor-3-2
Action controller refactor - deprecate Compatibility module
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/compatibility.rb | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 05dca445a4..7b73f86584 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -1,21 +1,22 @@ +require 'active_support/deprecation' + module ActionController module Compatibility extend ActiveSupport::Concern - class ::ActionController::ActionControllerError < StandardError #:nodoc: - end - # Temporary hax included do - ::ActionController::UnknownAction = ::AbstractController::ActionNotFound - ::ActionController::DoubleRenderError = ::AbstractController::DoubleRenderError + ::ActionController::UnknownAction = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('ActionController::UnknownAction', '::AbstractController::ActionNotFound') + ::ActionController::DoubleRenderError = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('ActionController::DoubleRenderError', '::AbstractController::DoubleRenderError') # ROUTES TODO: This should be handled by a middleware and route generation # should be able to handle SCRIPT_NAME self.config.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT'] - class << self - delegate :default_charset=, :to => "ActionDispatch::Response" + def self.default_charset=(new_charset) + ActiveSupport::Deprecation.warn "Setting default charset at controller level" \ + " is deprecated, please use `config.action_dispatch.default_charset` instead", caller + ActionDispatch::Response.default_charset = new_charset end self.protected_instance_variables = %w( @@ -24,13 +25,19 @@ module ActionController ) def rescue_action(env) + ActiveSupport::Deprecation.warn "Calling `rescue_action` is deprecated and will be removed in Rails 4.0.", caller raise env["action_dispatch.rescue.exception"] end end # For old tests - def initialize_template_class(*) end - def assign_shortcuts(*) end + def initialize_template_class(*) + ActiveSupport::Deprecation.warn "Calling `initialize_template_class` is deprecated and has no effect anymore.", caller + end + + def assign_shortcuts(*) + ActiveSupport::Deprecation.warn "Calling `assign_shortcuts` is deprecated and has no effect anymore.", caller + end def _normalize_options(options) options[:text] = nil if options.delete(:nothing) == true @@ -44,6 +51,9 @@ module ActionController end def _handle_method_missing + ActiveSupport::Deprecation.warn "Using `method_missing` to handle non" \ + " existing actions is deprecated and will be removed in Rails 4.0, " \ + " please use `action_missing` instead.", caller method_missing(@_action_name.to_sym) end @@ -52,6 +62,8 @@ module ActionController end def performed? + ActiveSupport::Deprecation.warn "Calling `performed?` is deprecated and will " \ + "be removed in Rails 4.0. Please check for `response_body` presence instead.", caller response_body end end |