Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

passing tests with mysql adapter on rails 2.1

  • Loading branch information...
commit 98eb9d1d69e03cb6465c93c0adb28762d5fd8511 1 parent a004058
@dan-manges authored
View
1  init.rb
@@ -3,7 +3,6 @@
if defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING < "1.2.0"
$stderr.puts "The QueryStats plugin requires Rails >= 1.2.0"
elsif !ActionController::Base.included_modules.include?(QueryStats::Labeler)
- p ActiveRecord::Base.connection.class
ActiveRecord::Base.connection.class.send :include, QueryStats::Recorder
ActionController::Base.send :include, QueryStats::Labeler
ActionController::Base.send :include, QueryStats::Logger
View
1  lib/query_stats/holder.rb
@@ -38,6 +38,7 @@ def initialize
# Add data to the array of stats - should only be called by the active record connection adapter.
def add(seconds, query, name = nil, *args) #:nodoc:
@stats.shift if @stats.size >= LIMIT
+ return if @ignore_types.include?(@query_type)
@stats << {
:sql => query,
:name => name,
View
13 test/database.yml
@@ -1,18 +1,9 @@
-sqlite:
- :adapter: sqlite
- :dbfile: plugin.sqlite.db
sqlite3:
adapter: sqlite3
dbfile: ":memory:"
-postgresql:
- :adapter: postgresql
- :username: postgres
- :password: postgres
- :database: plugin_test
- :min_messages: ERROR
mysql:
:adapter: mysql
:host: localhost
- :username: rails
+ :username: root
:password:
- :database: plugin_test
+ :database: plugin_test
View
2  test/schema.rb
@@ -1,5 +1,5 @@
ActiveRecord::Schema.define(:version => 1) do
- create_table :people do |t|
+ create_table :people, :force => true do |t|
t.column :name, :string
end
end
View
2  test/test_helper.rb
@@ -7,8 +7,6 @@
require "rails/version"
require 'active_record'
require 'active_record/fixtures'
-# require 'active_support/binding_of_caller'
-# require 'active_support/breakpoint'
require 'action_controller'
require 'action_controller/test_process'
Please sign in to comment.
Something went wrong with that request. Please try again.