aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/response.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-04-28 23:29:29 -0500
committerJoshua Peek <josh@joshpeek.com>2009-04-28 23:29:46 -0500
commitc0a372ba87f556769b98a6d06e8c684c3c3156df (patch)
treeac64ad4c56383731ba822088ffe4a697e77ef4ac /actionpack/lib/action_dispatch/http/response.rb
parent8925e89c6307b8b7c8aeb0277ae5e059904b2fc6 (diff)
downloadrails-c0a372ba87f556769b98a6d06e8c684c3c3156df.tar.gz
rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.tar.bz2
rails-c0a372ba87f556769b98a6d06e8c684c3c3156df.zip
Deprecate template, session, assigns, and layout accessors on response object. Instead access them through the controller instance. This mainly affects functional test assertions.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/response.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/response.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index f570b8e8ed..d104dcb8a0 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -34,20 +34,30 @@ module ActionDispatch # :nodoc:
DEFAULT_HEADERS = { "Cache-Control" => "no-cache" }
attr_accessor :request
- attr_accessor :template, :layout
attr_accessor :redirected_to, :redirected_to_method_params
attr_writer :header
alias_method :headers=, :header=
+ def template
+ ActiveSupport::Deprecation.warn("response.template has been deprecated. Use controller.template instead", caller)
+ @template
+ end
+ attr_writer :template
+
def session
ActiveSupport::Deprecation.warn("response.session has been deprecated. Use request.session instead", caller)
- request.session
+ @request.session
end
def assigns
ActiveSupport::Deprecation.warn("response.assigns has been deprecated. Use controller.assigns instead", caller)
- template.assigns
+ @template.controller.assigns
+ end
+
+ def layout
+ ActiveSupport::Deprecation.warn("response.layout has been deprecated. Use template.layout instead", caller)
+ @template.layout
end
delegate :default_charset, :to => 'ActionController::Base'