Sha256: 31ea1ac99174451d97541b02f827b187a20a7875be7e05b18add9457e306219f
Contents?: true
Size: 403 Bytes
Versions: 13
Compression:
Stored size: 403 Bytes
Contents
class << ActiveRecord::Base.connection IGNORED_SQL = [/^PRAGMA/, /^SELECT currval/, /^SELECT CAST/, /^SELECT @@IDENTITY/, /^SELECT @@ROWCOUNT/, /^SHOW FIELDS /] def execute_with_counting(sql, name = nil, &block) $query_count ||= 0 $query_count += 1 unless IGNORED_SQL.any? { |r| sql =~ r } execute_without_counting(sql, name, &block) end alias_method_chain :execute, :counting end
Version data entries
13 entries across 13 versions & 2 rubygems