Skip to content

Commit

Permalink
Merge pull request #10946 from arunagw/build_fix_for_object_const_get…
Browse files Browse the repository at this point in the history
…_nil

We need to check exception name to be nil
  • Loading branch information
fxn committed Jun 14, 2013
2 parents 6e34601 + 07d8294 commit 9fb17c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions activesupport/lib/active_support/inflector/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit 9fb17c9

Please sign in to comment.