<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,9 @@
 = Query Stats Change Log
 
+* July 12, 2008
+  * Rails 2.0 support
+  * Give statistics in response header
+
 * February 14, 2007
   * Fixed test_helper.rb so tests run without having the plugin in a Rails project.
   * No longer need to include QueryStats in ApplicationController
@@ -8,4 +12,4 @@
 
 * September 22, 2006
   * Fixed bug causing project test methods to fail when using assigns(:variable)
-  * Fixed bug which set label to :select after :columns, QueryStatsHolder#with_label will successfully ignore column queries.
\ No newline at end of file
+  * Fixed bug which set label to :select after :columns, QueryStatsHolder#with_label will successfully ignore column queries.</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -22,9 +22,19 @@ QueryStats adds the number of queries to the log in the DB section:
 * X-QueryCount will be set to the number of queries
 * X-QueryRuntime will be set to the db runtime
 
-== Contributors
+== Requirements
+
+Tests pass with:
+* Rails 1.2.6: sqlite3
+* Rails 2.0.2: sqlite3, mysql
+* Rails 2.1.0: sqlite3, mysql
+
+== Maintainer
 
 * Dan Manges
+
+== Contributors
+
 * Guillaume Dufloux
 
 == License</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,2 @@
-# QueryStats
-
-# The QueryStats module, which contains other modules for the plugin.
 module QueryStats
-  # Issues a warning that the QueryStats module no longer needs to be manually included in the ApplicationController.
-  def self.included(*args)
-    $stderr.puts &quot;You no longer need to include the QueryStats module in your controller.&quot;
-  end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/query_stats.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,5 @@
-# QueryStats::Helper
-
 module QueryStats
-  # Helper methods to access query stats data.
   module Helper
-    # Provides access to the QueryStatsHolder
     def queries
       ActiveRecord::Base.connection.queries
     end</diff>
      <filename>lib/query_stats/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,13 +3,9 @@
 module QueryStats
   # QueryStatsHolder holds data on queries executed.
   # QueryStatsHolder#stats will return an array of hashes containing the following keys:
-  # * type: The type of SQL query based on methods in ActiveRecord::ConnectionAdapters::AbstractAdapter
-  #   * begin_db_transaction
-  #   * columns
-  #   * commit_db_transaction
+  # * type: The type of SQL query
   #   * delete
   #   * insert
-  #   * rollback_db_transaction
   #   * select
   #   * update
   # * sql: The SQL executed.
@@ -68,7 +64,7 @@ module QueryStats
   
     # Return the total execution time for all queries in #stats.
     def runtime
-      @stats.inject(0) { |sum,query| sum + query[:seconds] }
+      @stats.map { |query| query[:seconds] }.sum
     end
     alias :total_time :runtime
   
@@ -99,4 +95,4 @@ module QueryStats
     end
 
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/query_stats/holder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,30 @@
-# QueryStats::Labeler
-
 module QueryStats
   # Automatically labels queries as to whether they were executed
   # in the controller or in the view.
   module Labeler
+    def self.included(base)
+      base.class_eval do
+        alias_method_chain :log_processing, :query_stats
+        alias_method_chain :render, :query_stats
+      end
+    end
+
     protected
     
-    # When the controller logs processing, QueryStats clears existing statistics.
-    def log_processing_with_query_stats()
+    def log_processing_with_query_stats
       queries.clear
       queries.label = :controller
       log_processing_without_query_stats
     end
 
-    # When rendering starts, start labeling queries with :view
     def render_with_query_stats(*args, &amp;block)
       queries.label = :view
       render_without_query_stats(*args, &amp;block)
     end
 
-    # Returns the QueryStats::Holder for the current database connection.
-    def queries #:nodoc:
+    def queries
       ActiveRecord::Base.connection.queries
     end
     
-    def self.included(base) #:nodoc:
-      base.class_eval do
-        alias_method_chain :log_processing, :query_stats
-        alias_method_chain :render, :query_stats
-      end
-    end
-
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/query_stats/labeler.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,14 @@
-# QueryStats::Logger
-
 module QueryStats
-  # Adds the query count to the log;
   module Logger
+    def self.included(base)
+      base.class_eval do
+        alias_method_chain :active_record_runtime, :query_stats
+        alias_method_chain :perform_action, :query_stats
+      end
+    end
+
     protected
-    # Append the query count to the active record data.
+
     def active_record_runtime_with_query_stats(*args, &amp;block)
       active_record_runtime_without_query_stats(*args, &amp;block) &lt;&lt; &quot; #{ActiveRecord::Base.connection.queries.count} queries&quot;
     end
@@ -15,11 +19,5 @@ module QueryStats
       response.headers[&quot;X-QueryRuntime&quot;] = &quot;%.5f&quot; % ActiveRecord::Base.connection.queries.runtime.to_s
     end
   
-    def self.included(base) #:nodoc:
-      base.class_eval do
-        alias_method_chain :active_record_runtime, :query_stats
-        alias_method_chain :perform_action, :query_stats
-      end
-    end
   end
 end</diff>
      <filename>lib/query_stats/logger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,15 @@
-# QueryStats::Recorder
-
 module QueryStats
-  # Captures query data from ActiveRecord::Base.
   module Recorder
-    def self.included(base) #:nodoc:
+    def self.included(base)
       base.class_eval do
         alias_method_chain :execute, :query_stats
       end
     end
     
-    # Returns or initializes the QueryStats::Holder
     def queries
       @query_stats ||= QueryStats::Holder.new
     end
     
-    # Executes the query, capturing execution time and logging data to the
-    # QueryStats::Holder
     def execute_with_query_stats(*args)
       result = nil
       seconds = Benchmark.realtime do</diff>
      <filename>lib/query_stats/recorder.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>install.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>f3003ad13e0d2be5a00965cbd14b57edab3d9c41</id>
    </parent>
  </parents>
  <author>
    <name>Dan Manges</name>
    <email>daniel.manges@gmail.com</email>
  </author>
  <url>http://github.com/dan-manges/query_stats/commit/48c4474390e5a5e773768dcf33f4a2ed4b371c80</url>
  <id>48c4474390e5a5e773768dcf33f4a2ed4b371c80</id>
  <committed-date>2008-08-24T16:25:03-07:00</committed-date>
  <authored-date>2008-08-24T16:25:03-07:00</authored-date>
  <message>minor cleanup</message>
  <tree>6d2215f6520ea49dcfd0d485fdfb7ffd16fb47d1</tree>
  <committer>
    <name>Dan Manges</name>
    <email>daniel.manges@gmail.com</email>
  </committer>
</commit>
