Module: Oboe::Inst::ConnectionAdapters::PostgreSQLAdapter

Includes:
Utils
Defined in:
lib/oboe/frameworks/rails/inst/active_record.rb

Overview

Utils

Class Method Summary collapse

Methods included from Utils

#begin_db_transaction_with_oboe, #cfg, #exec_delete_with_oboe, #exec_insert_with_oboe, #exec_query_with_oboe, #execute_with_oboe, #extract_trace_details, #ignore_payload?

Class Method Details

.included(cls) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oboe/frameworks/rails/inst/active_record.rb', line 103

def self.included(cls)
  cls.class_eval do
    if ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::method_defined? :exec_query
      alias exec_query_without_oboe exec_query
      alias exec_query exec_query_with_oboe
    else puts "[oboe/loading] Couldn't properly instrument ActiveRecord layer.  Partial traces may occur."
    end
      
    if ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::method_defined? :exec_delete
      alias exec_delete_without_oboe exec_delete
      alias exec_delete exec_delete_with_oboe
    else puts "[oboe/loading] Couldn't properly instrument ActiveRecord layer.  Partial traces may occur."
    end
  end
end