Browse files

Fix TemplateError so it doesn't bomb on exceptions while running test…

…s [rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 5ae821a commit 8afb4e136b2482e1e3826d3e00981b4b89680e1a @technoweenie technoweenie committed Nov 26, 2007
Showing with 5 additions and 3 deletions.
  1. +2 −0 actionpack/CHANGELOG
  2. +3 −3 actionpack/lib/action_view/template_error.rb
View
2 actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fix TemplateError so it doesn't bomb on exceptions while running tests [rick]
+
* Fixed that named routes living under resources shouldn't have double slashes #10198 [isaacfeliu]
* Make sure that cookie sessions use a secret that is at least 30 chars in length. [Koz]
View
6 actionpack/lib/action_view/template_error.rb
@@ -81,9 +81,9 @@ def backtrace
private
def strip_base_path(path)
- File.expand_path(path).
- gsub(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '').
- gsub(@base_path, "")
+ stripped_path = File.expand_path(path).gsub(@base_path, "")
+ stripped_path.gsub!(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '') if defined?(RAILS_ROOT)
+ stripped_path
end
def source_location

0 comments on commit 8afb4e1

Please sign in to comment.