Sha256: b8f16a9752dbad3f7a2e44cdc63664fd55627988cecc9c40c05ff7531b98c5a0

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

# Copyright (c) 2013 AppNeta, Inc.
# All rights reserved.

module Oboe
  module Inst
    module ConnectionAdapters
      module FlavorInitializers
        def self.mysql2
          Oboe.logger.info "[oboe/loading] Instrumenting activerecord mysql2adapter" if Oboe::Config[:verbose]

          Oboe::Util.send_include(::ActiveRecord::ConnectionAdapters::Mysql2Adapter,
                                    Oboe::Inst::ConnectionAdapters::Utils)

          if (::ActiveRecord::VERSION::MAJOR == 3 and ::ActiveRecord::VERSION::MINOR == 0) or
              ::ActiveRecord::VERSION::MAJOR == 2
            # ActiveRecord 3.0 and prior
            Oboe::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :execute)
          else
            # ActiveRecord 3.1 and above
            Oboe::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :exec_insert)
            Oboe::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :exec_query)
            Oboe::Util.method_alias(::ActiveRecord::ConnectionAdapters::Mysql2Adapter, :exec_delete)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
oboe-2.7.1.7 lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb
oboe-2.7.1.7-java lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb
oboe-2.7.0.3-java lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb
oboe-2.7.0.3 lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb
oboe-2.6.8 lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb
oboe-2.6.7.1 lib/oboe/frameworks/rails/inst/connection_adapters/mysql2.rb