From cb8b0f4a5aac04a327a884b5413ccdb184715da8 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 15 Oct 2009 13:35:22 -0700 Subject: [PATCH] Make this less brittle and work on 1.8 --- actionpack/lib/action_view/base.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index b4c91a772f..58dae0bb0f 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -241,16 +241,16 @@ module ActionView #:nodoc: # they are in AC. if controller.class.respond_to?(:_helper_serial) klass = @views[controller.class._helper_serial] ||= Class.new(self) do - const_set(:CONTROLLER_CLASS, controller.class) - # Try to make stack traces clearer - def self.name - "ActionView for #{CONTROLLER_CLASS}" - end + class_eval <<-ruby_eval, __FILE__, __LINE__ + 1 + def self.name + "ActionView for #{controller.class}" + end - def inspect - "#<#{self.class.name}>" - end + def inspect + "#<#{self.class.name}>" + end + ruby_eval if controller.respond_to?(:_helpers) include controller._helpers