From 20baeece919629b7e43b86aebb05f8e2af6d19ef Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 15 Jan 2012 23:21:08 -0200 Subject: Add some deprecations for logic being removed in 4.0 --- actionpack/lib/action_controller/metal/compatibility.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb index 05dca445a4..76292db0b3 100644 --- a/actionpack/lib/action_controller/metal/compatibility.rb +++ b/actionpack/lib/action_controller/metal/compatibility.rb @@ -1,3 +1,5 @@ +require 'active_support/deprecation' + module ActionController module Compatibility extend ActiveSupport::Concern @@ -24,13 +26,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 +52,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 +63,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 -- cgit v1.2.3