1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #10946 from arunagw/build_fix_for_object_const_get_nil

We need to check exception name to be nil
This commit is contained in:
Xavier Noria 2013-06-14 15:24:02 -07:00
commit 9fb17c9093

View file

@ -322,6 +322,9 @@ module ActiveSupport
# For instance, Foo::Bar::Baz will generate Foo(::Bar(::Baz)?)? # For instance, Foo::Bar::Baz will generate Foo(::Bar(::Baz)?)?
def const_regexp(camel_cased_word) #:nodoc: def const_regexp(camel_cased_word) #:nodoc:
parts = camel_cased_word.split("::") parts = camel_cased_word.split("::")
return Regexp.escape(camel_cased_word) if parts.blank?
last = parts.pop last = parts.pop
parts.reverse.inject(last) do |acc, part| parts.reverse.inject(last) do |acc, part|