diff options
Diffstat (limited to 'activerecord/test/cases/helper.rb')
-rw-r--r-- | activerecord/test/cases/helper.rb | 11 |
1 files changed, 7 insertions, 4 deletions
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 |