aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-23 07:44:57 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-23 07:44:57 +0000
commit27ff573290e6927c15e9d6d3fa6a4432b31ae1aa (patch)
tree5107c75a8d8ee0cd3b94b732626a61bf728160f8 /actionpack/lib
parentf78a1948d267ebacff381507980e1f331ad4a3fb (diff)
downloadrails-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-xactionpack/lib/action_controller/base.rb11
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)