From d8acaf2b66be431ccd594cb90afc4ef2dc470b34 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Sat, 27 Feb 2010 11:51:19 -0800 Subject: Remove the noisy lines involving AS::Dependencies from the NameError stack trace if a constant cannot be found. --- activesupport/lib/active_support/dependencies.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 96478ee947..2d7aa7e1e6 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -441,7 +441,10 @@ module ActiveSupport #:nodoc: qualified_name = qualified_name_for from_mod, const_name path_suffix = qualified_name.underscore + + trace = caller.reject {|l| l =~ %r{#{__FILE__}}} name_error = NameError.new("uninitialized constant #{qualified_name}") + name_error.set_backtrace(trace) file_path = search_for_file(path_suffix) -- cgit v1.2.3