Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 27ff573290e6927c15e9d6d3fa6a4432b31ae1aa 1 parent f78a194
@jeremy jeremy authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 actionpack/lib/action_controller/base.rb
View
11 actionpack/lib/action_controller/base.rb
@@ -1076,11 +1076,12 @@ def reset_session #:doc:
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)
Please sign in to comment.
Something went wrong with that request. Please try again.