Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 1221

Show
Ignore:
Timestamp:
04/19/05 09:54:10 (3 years ago)
Author:
david
Message:

Fixed that rendering a template would require a connection to the database #1146

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r1216 r1221  
     1*SVN* 
     2 
     3* Fixed that rendering a template would require a connection to the database #1146 
     4 
     5 
    16*1.8.0* (19th April, 2005) 
    27 
  • trunk/actionpack/lib/action_controller/benchmarking.rb

    r1070 r1221  
    2020        render_without_benchmark(template_name, status) 
    2121      else 
    22         db_runtime = ActiveRecord::Base.connection.reset_runtime 
     22        db_runtime = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? 
    2323        @rendering_runtime = Benchmark::measure{ render_without_benchmark(template_name, status) }.real 
    2424        @db_rt_before_render = db_runtime 
    25         @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime 
     25        @db_rt_after_render = ActiveRecord::Base.connection.reset_runtime if Object.const_defined?("ActiveRecord") && ActiveRecord::Base.connected? 
    2626        @rendering_runtime -= @db_rt_after_render 
    2727      end