From 8925e89c6307b8b7c8aeb0277ae5e059904b2fc6 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 28 Apr 2009 16:32:26 -0500 Subject: Deprecate response.assigns --- actionpack/lib/action_dispatch/http/response.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index ebba4eefa0..f570b8e8ed 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -34,7 +34,7 @@ module ActionDispatch # :nodoc: DEFAULT_HEADERS = { "Cache-Control" => "no-cache" } attr_accessor :request - attr_accessor :assigns, :template, :layout + attr_accessor :template, :layout attr_accessor :redirected_to, :redirected_to_method_params attr_writer :header @@ -45,12 +45,16 @@ module ActionDispatch # :nodoc: request.session end + def assigns + ActiveSupport::Deprecation.warn("response.assigns has been deprecated. Use controller.assigns instead", caller) + template.assigns + end + delegate :default_charset, :to => 'ActionController::Base' def initialize super @header = Rack::Utils::HeaderHash.new(DEFAULT_HEADERS) - @session, @assigns = [], [] end # The response code of the request -- cgit v1.2.3