diff options
-rw-r--r-- | actionpack/CHANGELOG | 5 | ||||
-rw-r--r-- | actionpack/lib/action_controller/benchmarking.rb | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 5682a021bf..8c1302b431 100644 --- a/actionpack/CHANGELOG +++ b/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] diff --git a/actionpack/lib/action_controller/benchmarking.rb b/actionpack/lib/action_controller/benchmarking.rb index 6f4c248d70..1cc7adb8eb 100644 --- a/actionpack/lib/action_controller/benchmarking.rb +++ b/actionpack/lib/action_controller/benchmarking.rb @@ -19,10 +19,10 @@ module ActionController #:nodoc: 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 |