diff options
author | Jonathan del Strother <jon.delStrother@audioboo.fm> | 2011-07-27 00:06:19 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:19 -0700 |
commit | ab422b04a2fd8144a26d82f2ec1efeeb684b29db (patch) | |
tree | 782c1d8311056fe38e1f6fe5fb699ee32e3e39e8 /activesupport | |
parent | f1403f930358dcd8c66d8bc276da11874546ed2f (diff) | |
download | rails-ab422b04a2fd8144a26d82f2ec1efeeb684b29db.tar.gz rails-ab422b04a2fd8144a26d82f2ec1efeeb684b29db.tar.bz2 rails-ab422b04a2fd8144a26d82f2ec1efeeb684b29db.zip |
Replace unnecessary regexp in Dependencies#load_missing_constant
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 3 |
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) |