Make error reporting work with Rails 2.0.{0,1}

This commit is contained in:
Nathan Weizenbaum 2008-04-17 18:08:58 -07:00
parent 14882b839e
commit b3c4658fde
1 changed files with 8 additions and 1 deletions

View File

@ -42,7 +42,14 @@ module ActionView
logger.debug "Backtrace: #{e.backtrace.join("\n")}"
end
raise TemplateError.new(@base_path, file_name || template, @assigns, template, e)
base_path = if defined?(extract_base_path_from)
# Rails 2.0.x
extract_base_path_from(file_name) || view_paths.first
else
# Rails <=1.2.6
@base_path
end
raise ActionView::TemplateError.new(base_path, file_name || template, @assigns, template, e)
end
@@compile_time[render_symbol] = Time.now