From b7e4a97ab54f914bc464d9b3c7d8e579dd402771 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 21 Sep 2010 14:42:28 -0700 Subject: fixing tests. woo --- activerecord/test/cases/helper.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index 19a8a97c1a..2d3047c875 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -57,14 +57,17 @@ ActiveRecord::Base.connection.class.class_eval do alias_method_chain :execute, :query_record end -ActiveRecord::Base.connection.extend Module.new { +ActiveRecord::Base.connection.class.class_eval { attr_accessor :column_calls - def columns(*args) + + def columns_with_calls(*args) + @column_calls ||= 0 @column_calls += 1 - super + columns_without_calls(*args) end + + alias_method_chain :columns, :calls } -ActiveRecord::Base.connection.column_calls = 0 unless ENV['FIXTURE_DEBUG'] module ActiveRecord::TestFixtures::ClassMethods -- cgit v1.2.3