Skip to content
Browse files

Fixed that rendering a template would require a connection to the dat…

…abase #1146

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent cdf88b7 commit 420b830b00e5b615bf6ef713a27d95bac435b752 @dhh dhh committed Apr 19, 2005
Showing with 7 additions and 2 deletions.
  1. +5 −0 actionpack/CHANGELOG
  2. +2 −2 actionpack/lib/action_controller/benchmarking.rb
View
5 actionpack/CHANGELOG
@@ -1,3 +1,8 @@
+*SVN*
+
+* Fixed that rendering a template would require a connection to the database #1146
+
+
*1.8.0* (19th April, 2005)
* Added assert_tag and assert_no_tag as a much improved alternative to the deprecated assert_template_xpath_match #1126 [Jamis Buck]
View
4 actionpack/lib/action_controller/benchmarking.rb
@@ -19,10 +19,10 @@ def render_with_benchmark(template_name = default_template_name, status = "200 O
if logger.nil?
render_without_benchmark(template_name, status)
else
- db_runtime = ActiveRecord::Base.connection.reset_runtime
+ db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected?
@rendering_runtime = Benchmark::measure{ render_without_benchmark(template_name, status) }.real
@db_rt_before_render = db_runtime
- @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime
+ @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected?
@rendering_runtime -= @db_rt_after_render
end
end

0 comments on commit 420b830

Please sign in to comment.
Something went wrong with that request. Please try again.