aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-10-09 00:53:48 -1000
committerYehuda Katz <wycats@gmail.com>2009-10-09 00:53:48 -1000
commitee37ff46e9ad381a8331a6a3deed001b001f75ee (patch)
treeb07fc625206f0fcd7355d11b44b4653a6ae99fbd /actionpack/lib
parent69aa5e8a86b1d33e057076dc6049e37c92b0e50f (diff)
downloadrails-ee37ff46e9ad381a8331a6a3deed001b001f75ee.tar.gz
rails-ee37ff46e9ad381a8331a6a3deed001b001f75ee.tar.bz2
rails-ee37ff46e9ad381a8331a6a3deed001b001f75ee.zip
Get rid of constant name usage for stack trace help in favor of overriding #inspect and .name.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/base.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 82b419d846..31e9c5ef9d 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -236,15 +236,15 @@ module ActionView #:nodoc:
# they are in AC.
if controller.class.respond_to?(:_helper_serial)
klass = @views[controller.class._helper_serial] ||= Class.new(self) do
- name = controller.class.name.gsub(/::/, '__')
-
- Subclasses.class_eval do
- if method(:const_defined?).arity == 1
- remove_const(name) if const_defined?(name) # Ruby 1.8.x
- else
- remove_const(name) if const_defined?(name, false) # Ruby 1.9.x
- end
- const_set(name, self)
+ const_set(:CONTROLLER_CLASS, controller.class)
+
+ # Try to make stack traces clearer
+ def self.name
+ "ActionView for #{CONTROLLER_CLASS}"
+ end
+
+ def inspect
+ "#<#{self.class.name}>"
end
if controller.respond_to?(:_helpers)