diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-07 17:32:01 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-07 17:32:01 -0800 |
commit | 38a8f7f8ba22ee03bf5320921775e76c071d460e (patch) | |
tree | 395e1dfd1836b5662ce648f46fb7a79e68f8796d | |
parent | 76c29a64b940ca82c7a15de5598f5340046b9cca (diff) | |
download | rails-38a8f7f8ba22ee03bf5320921775e76c071d460e.tar.gz rails-38a8f7f8ba22ee03bf5320921775e76c071d460e.tar.bz2 rails-38a8f7f8ba22ee03bf5320921775e76c071d460e.zip |
speeding up ignored sql testing
-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 |