diff options
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/compatibility.rb | 32 | ||||
-rw-r--r-- | actionpack/lib/action_controller/metal/http_authentication.rb | 2 |
3 files changed, 24 insertions, 14 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index 125dbf6bb5..9b0c8e0ce3 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -192,6 +192,10 @@ module ActionController super body end + def performed? + response_body + end + def dispatch(name, request) #:nodoc: @_request = request @_env = request.env diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 05dca445a4..de3354d4f9 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,15 +51,14 @@ 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 def method_for_action(action_name) super || (respond_to?(:method_missing) && "_handle_method_missing") end - - def performed? - response_body - end end end diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index fcb21907a3..9f2f5476fa 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -67,7 +67,7 @@ module ActionController # class PostsController < ApplicationController # REALM = "SuperSecret" # USERS = {"dhh" => "secret", #plain text password - # "dap" => Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":")) #ha1 digest password + # "dap" => Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password # # before_filter :authenticate, :except => [:index] # |