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:
commit
9fb17c9093
1 changed files with 3 additions and 0 deletions
|
@ -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|
|
||||||
|
|
Loading…
Reference in a new issue