diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/helper.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index 6735bc521b..c62a172a1c 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -65,6 +65,9 @@ module ActiveRecord # ignored SQL. This ignored SQL is for Oracle. ignored_sql.concat [/^select .*nextval/i, /^SAVEPOINT/, /^ROLLBACK TO/, /^\s*select .* from all_triggers/im] + cattr_accessor :ignored_sql_regexp + self.ignored_sql_regexp = Regexp.union ignored_sql + cattr_accessor :log self.log = [] @@ -74,7 +77,7 @@ module ActiveRecord # FIXME: this seems bad. we should probably have a better way to indicate # the query was cached unless 'CACHE' == values[:name] - self.class.log << sql unless self.class.ignored_sql.any? { |r| sql =~ r } + self.class.log << sql unless self.class.ignored_sql_regexp =~ sql end end end |