mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Get rid of constant name usage for stack trace help in favor of overriding #inspect and .name.
This commit is contained in:
parent
69aa5e8a86
commit
ee37ff46e9
1 changed files with 8 additions and 8 deletions
|
@ -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(/::/, '__')
|
||||
const_set(:CONTROLLER_CLASS, controller.class)
|
||||
|
||||
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)
|
||||
# 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)
|
||||
|
|
Loading…
Reference in a new issue