From c0a372ba87f556769b98a6d06e8c684c3c3156df Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 28 Apr 2009 23:29:29 -0500 Subject: Deprecate template, session, assigns, and layout accessors on response object. Instead access them through the controller instance. This mainly affects functional test assertions. --- actionpack/lib/action_view/base.rb | 2 +- actionpack/lib/action_view/render/rendering.rb | 2 +- actionpack/lib/action_view/test_case.rb | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index d087395361..44bd401631 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -191,7 +191,7 @@ module ActionView #:nodoc: ActionController::Base.allow_concurrency || (cache_template_loading.nil? ? !ActiveSupport::Dependencies.load? : cache_template_loading) end - attr_internal :request + attr_internal :request, :layout delegate :controller_path, :to => :controller, :allow_nil => true diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index f174053b86..6e368f27eb 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -46,7 +46,7 @@ module ActionView locals ||= {} if controller && layout - response.layout = layout.identifier if controller.respond_to?(:response) + @_layout = layout.identifier logger.info("Rendering template within #{layout.identifier}") if logger end diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index dddd671812..50bed67f7d 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -7,7 +7,8 @@ module ActionView @_rendered = { :template => nil, :partials => Hash.new(0) } initialize_without_template_tracking(*args) end - + + attr_internal :rendered alias_method :_render_template_without_template_tracking, :_render_template def _render_template(template, local_assigns = {}) if template.respond_to?(:identifier) @@ -16,7 +17,7 @@ module ActionView @_rendered[:template] << template end _render_template_without_template_tracking(template, local_assigns) - end + end end class TestCase < ActiveSupport::TestCase -- cgit v1.2.3