Sha256: 3c64642fca484eb0cf8071f9adb6a31f3ef8913938eb1d0e15668f6a74b8e574
Contents?: true
Size: 715 Bytes
Versions: 13
Compression:
Stored size: 715 Bytes
Contents
module ARTest module SQLServer module SqlCounterSqlserver # Only return the log vs. log_all def capture_sql_ss ActiveRecord::SQLCounter.clear_log yield ActiveRecord::SQLCounter.log.dup end end ignored_sql = [ /INFORMATION_SCHEMA\.(TABLES|VIEWS|COLUMNS|KEY_COLUMN_USAGE)/im, /SELECT @@version/, /SELECT @@TRANCOUNT/, /(BEGIN|COMMIT|ROLLBACK|SAVE) TRANSACTION/, /SELECT CAST\(.* AS .*\) AS value/, /SELECT DATABASEPROPERTYEX/im ] sqlcounter = ObjectSpace.each_object(ActiveRecord::SQLCounter).to_a.first sqlcounter.instance_variable_set :@ignore, Regexp.union(ignored_sql.push(sqlcounter.ignore)) end end
Version data entries
13 entries across 13 versions & 2 rubygems