diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-19 09:54:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-19 09:54:10 +0000 |
commit | 420b830b00e5b615bf6ef713a27d95bac435b752 (patch) | |
tree | 2947a9878478176e9e072ac2b0553a225fe30738 | |
parent | cdf88b7b04a1d9a928410b1c90a8f1c1bc053c89 (diff) | |
download | rails-420b830b00e5b615bf6ef713a27d95bac435b752.tar.gz rails-420b830b00e5b615bf6ef713a27d95bac435b752.tar.bz2 rails-420b830b00e5b615bf6ef713a27d95bac435b752.zip |
Fixed that rendering a template would require a connection to the database #1146
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-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 |