aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-26 16:19:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-26 16:19:48 -0700
commite4a7b23d382d9cf66771c0ce3eefe35c08e3711a (patch)
treed7f967a5b4f60afdc7d81c6d52e51c5af8a7ba2a
parent6089ecf93187fbd47c7b3f11b58c88f0de09940a (diff)
parent43ef635b95089ec7a6afb74f154286080aef8d5b (diff)
downloadrails-e4a7b23d382d9cf66771c0ce3eefe35c08e3711a.tar.gz
rails-e4a7b23d382d9cf66771c0ce3eefe35c08e3711a.tar.bz2
rails-e4a7b23d382d9cf66771c0ce3eefe35c08e3711a.zip
Merge pull request #2291 from jdelStrother/load_missing_constant
Replace unnecessary regexp in Dependencies#load_missing_constant
-rw-r--r--activesupport/lib/active_support/dependencies.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index a60697cb12..8cd4d15e4c 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -466,7 +466,6 @@ module ActiveSupport #:nodoc:
# Load the constant named +const_name+ which is missing from +from_mod+. If
# it is not possible to load the constant into from_mod, try its parent module
# using const_missing.
- THIS_FILE = %r{#{Regexp.escape(__FILE__)}}
def load_missing_constant(from_mod, const_name)
log_call from_mod, const_name
@@ -479,7 +478,7 @@ module ActiveSupport #:nodoc:
qualified_name = qualified_name_for from_mod, const_name
path_suffix = qualified_name.underscore
- trace = caller.reject {|l| l =~ THIS_FILE}
+ trace = caller.reject {|l| l.starts_with? __FILE__ }
name_error = NameError.new("uninitialized constant #{qualified_name}")
name_error.set_backtrace(trace)