diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-23 07:44:57 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-23 07:44:57 +0000 |
commit | 27ff573290e6927c15e9d6d3fa6a4432b31ae1aa (patch) | |
tree | 5107c75a8d8ee0cd3b94b732626a61bf728160f8 /actionpack/lib | |
parent | f78a1948d267ebacff381507980e1f331ad4a3fb (diff) | |
download | rails-27ff573290e6927c15e9d6d3fa6a4432b31ae1aa.tar.gz rails-27ff573290e6927c15e9d6d3fa6a4432b31ae1aa.tar.bz2 rails-27ff573290e6927c15e9d6d3fa6a4432b31ae1aa.zip |
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
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 11 |
1 files changed, 6 insertions, 5 deletions
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) |