diff options
author | Yuki Nishijima <mail@yukinishijima.net> | 2014-06-24 10:07:29 -0700 |
---|---|---|
committer | Yuki Nishijima <mail@yukinishijima.net> | 2014-06-24 10:13:17 -0700 |
commit | 98f0cab3965bf5f373182ee62c20c3d94fb47dad (patch) | |
tree | 222bd9377f98a2c678f00c1df6e7b4f8bc933e0e /activesupport/lib/active_support | |
parent | 44c9489a687016c599a2470ee06885c431b7b810 (diff) | |
download | rails-98f0cab3965bf5f373182ee62c20c3d94fb47dad.tar.gz rails-98f0cab3965bf5f373182ee62c20c3d94fb47dad.tar.bz2 rails-98f0cab3965bf5f373182ee62c20c3d94fb47dad.zip |
Fix a bug where NameError#name returns a qualified name in string
Ruby's original behaviour is that :
* It only returns a const name, not a qualified aname
* It returns a symbol, not a string
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index a8d12366cc..93a11d4586 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -187,7 +187,7 @@ module ActiveSupport #:nodoc: # top-level constant. def guess_for_anonymous(const_name) if Object.const_defined?(const_name) - raise NameError.new "#{const_name} cannot be autoloaded from an anonymous class or module", const_name.to_s + raise NameError.new "#{const_name} cannot be autoloaded from an anonymous class or module", const_name else Object end @@ -516,7 +516,7 @@ module ActiveSupport #:nodoc: end end - name_error = NameError.new("uninitialized constant #{qualified_name}", qualified_name) + name_error = NameError.new("uninitialized constant #{qualified_name}", const_name) name_error.set_backtrace(caller.reject {|l| l.starts_with? __FILE__ }) raise name_error end |