Class: Mysql2::Client
- Inherits:
-
Object
- Object
- Mysql2::Client
- Includes:
- MiniProfiler
- Defined in:
- lib/patches/db/mysql2/alias_method.rb,
lib/patches/db/mysql2/prepend.rb
Defined Under Namespace
Modules: MiniProfiler
Instance Method Summary collapse
Instance Method Details
#query(*args, &blk) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/patches/db/mysql2/alias_method.rb', line 21 def query(*args, &blk) return query_without_profiling(*args, &blk) unless SqlPatches.should_measure? result, record = SqlPatches.record_sql(args[0]) do query_without_profiling(*args, &blk) end result.instance_variable_set("@miniprofiler_sql_id", record) if result result end |
#query_without_profiling ⇒ Object
20 |
# File 'lib/patches/db/mysql2/alias_method.rb', line 20 alias_method :query_without_profiling, :query |