From 27ff573290e6927c15e9d6d3fa6a4432b31ae1aa Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 23 May 2007 07:44:57 +0000 Subject: Don't play with fire (anonymous class and returning block). git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6820 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/base.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index cfd60ac6bf..b2ad440997 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -1076,11 +1076,12 @@ module ActionController #:nodoc: private def self.view_class - @view_class ||= - # create a new class based on the default template class and include helper methods - returning Class.new(ActionView::Base) do |view_class| - view_class.send(:include, master_helper_module) - end + unless defined? @view_class + # Create a template subclass including helper methods. + @view_class = Class.new(ActionView::Base) + @view_class.send(:include, master_helper_module) + end + @view_class end def initialize_template_class(response) -- cgit v1.2.3