aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2013-06-14 15:24:02 -0700
committerXavier Noria <fxn@hashref.com>2013-06-14 15:24:02 -0700
commit9fb17c9093bc49e2e3f5cf7b5655baf507ab45ed (patch)
tree16360a07fcc36e563a477de181180a1822e11b7f
parent6e34601653614ca98f632d14662b4852bc351abe (diff)
parent07d8294b943a7978f09720fac353498f462d716a (diff)
downloadrails-9fb17c9093bc49e2e3f5cf7b5655baf507ab45ed.tar.gz
rails-9fb17c9093bc49e2e3f5cf7b5655baf507ab45ed.tar.bz2
rails-9fb17c9093bc49e2e3f5cf7b5655baf507ab45ed.zip
Merge pull request #10946 from arunagw/build_fix_for_object_const_get_nil
We need to check exception name to be nil
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index 665545db3b..9f417af826 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -322,6 +322,9 @@ module ActiveSupport
# 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|