Permalink
Browse files

Merge pull request #10946 from arunagw/build_fix_for_object_const_get…

…_nil

We need to check exception name to be nil
  • Loading branch information...
fxn committed Jun 14, 2013
2 parents 6e34601 + 07d8294 commit 9fb17c9093bc49e2e3f5cf7b5655baf507ab45ed
Showing with 3 additions and 0 deletions.
  1. +3 −0 activesupport/lib/active_support/inflector/methods.rb
@@ -322,6 +322,9 @@ def ordinalize(number)
# For instance, Foo::Bar::Baz will generate Foo(::Bar(::Baz)?)?
def const_regexp(camel_cased_word) #:nodoc:
parts = camel_cased_word.split("::")
+
+ return Regexp.escape(camel_cased_word) if parts.blank?
+
last = parts.pop
parts.reverse.inject(last) do |acc, part|

0 comments on commit 9fb17c9

Please sign in to comment.