Sha256: c9d901f5eeafff38c8a82b006b42ff2340703193a8d7161bd1c9951e0ba17589

Contents?: true

Size: 648 Bytes

Versions: 42

Compression:

Stored size: 648 Bytes

Contents

require 'ddtrace/contrib/patcher'
require 'ddtrace/contrib/active_record/events'

module Datadog
  module Contrib
    module ActiveRecord
      # Patcher enables patching of 'active_record' module.
      module Patcher
        include Contrib::Patcher

        module_function

        def patched?
          done?(:active_record)
        end

        def patch
          do_once(:active_record) do
            begin
              Events.subscribe!
            rescue StandardError => e
              Datadog::Tracer.log.error("Unable to apply Active Record integration: #{e}")
            end
          end
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
ls-trace-0.1.2 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.29.1 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.26.1 lib/ddtrace/contrib/active_record/patcher.rb
ls-trace-0.1.1 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.29.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.28.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.27.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.26.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.25.1 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.25.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.24.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.23.3 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.23.2 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.23.1 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.23.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.22.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.21.2 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.21.1 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.21.0 lib/ddtrace/contrib/active_record/patcher.rb
ddtrace-0.20.0 lib/ddtrace/contrib/active_record/patcher.rb