mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Replace unnecessary regexp in Dependencies#load_missing_constant
This commit is contained in:
committed by
Xavier Noria
parent
f1403f9303
commit
ab422b04a2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user