Permalink
Browse files

Remove the noisy lines involving AS::Dependencies from the NameError …

…stack trace if a constant cannot be found.
  • Loading branch information...
1 parent 8247bd9 commit d8acaf2b66be431ccd594cb90afc4ef2dc470b34 Yehuda Katz committed Feb 27, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 activesupport/lib/active_support/dependencies.rb
@@ -441,7 +441,10 @@ def load_missing_constant(from_mod, const_name)
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)

0 comments on commit d8acaf2

Please sign in to comment.