aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/test/abstract_unit.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index e08612cc34..0ddefd8e92 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Add a list of regexes assert_queries skips in the ActiveRecord test suite. [Rick]
+
* Fix the has_and_belongs_to_many #create doesn't populate the join for new records. Closes #3692 [josh@hasmanythrough.com]
* Provide Association Extensions access to the instance that the association is being accessed from.
diff --git a/activerecord/test/abstract_unit.rb b/activerecord/test/abstract_unit.rb
index 29e4601fee..881d26fac8 100755
--- a/activerecord/test/abstract_unit.rb
+++ b/activerecord/test/abstract_unit.rb
@@ -56,9 +56,13 @@ end
ActiveRecord::Base.connection.class.class_eval do
cattr_accessor :query_count
+
+ # Array of regexes of queries that are not counted against query_count
+ @@ignore_list = [/^SELECT currval/]
+
alias_method :execute_without_query_counting, :execute
def execute_with_query_counting(sql, name = nil)
- self.query_count += 1
+ self.query_count += 1 unless @@ignore_list.any? { |r| sql =~ r }
execute_without_query_counting(sql, name)
end
end