Permalink
Browse files

Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a s…

…pecial case in assert_queries
  • Loading branch information...
1 parent fa8dfad commit de01a6410207efd9554e9d1ed901c180e54d632a @jonleighton jonleighton committed Jun 12, 2011
Showing with 1 addition and 2 deletions.
  1. +0 −1 activerecord/lib/active_record/test_case.rb
  2. +1 −1 activerecord/test/cases/helper.rb
@@ -46,7 +46,6 @@ def assert_queries(num = 1)
$queries_executed = []
yield
ensure
- %w{ BEGIN COMMIT }.each { |x| $queries_executed.delete(x) }
assert_equal num, $queries_executed.size, "#{$queries_executed.size} instead of #{num} queries were executed.#{$queries_executed.size == 0 ? '' : "\nQueries:\n#{$queries_executed.join("\n")}"}"
end
@@ -58,7 +58,7 @@ def with_active_record_default_timezone(zone)
module ActiveRecord
class SQLCounter
- IGNORED_SQL = [/^PRAGMA (?!(table_info))/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^SHOW max_identifier_length/]
+ IGNORED_SQL = [/^PRAGMA (?!(table_info))/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^SHOW max_identifier_length/, /^BEGIN/, /^COMMIT/]
# FIXME: this needs to be refactored so specific database can add their own
# ignored SQL. This ignored SQL is for Oracle.

0 comments on commit de01a64

Please sign in to comment.