Sha256: 83451b0740584bfc6fa5f1961f07d0eed8104cbcf38fc68527024d061f86f93a

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

require_relative './sql_analyzer/monkeypatches/query'
require_relative './sql_analyzer/monkeypatches/tagger'
require_relative './sql_analyzer/analyzer'
require_relative './sql_analyzer/logger'
require_relative './sql_analyzer/compact_logger'
require_relative './sql_analyzer/redacted_logger'
require_relative './sql_analyzer/background_processor'
require_relative './sql_analyzer/configuration'
require_relative './sql_analyzer/redactor'
require_relative './sql_analyzer/backtrace_filter'
require_relative './sql_analyzer/version'

module ActiveRecord
  module SqlAnalyzer
    def self.configure
      @config ||= Configuration.new
      yield @config
      @config
    end

    def self.config
      @config
    end

    def self.background_processor
      @background_processor ||= BackgroundProcessor.new
    end

    def self.install!
      return if @installed
      @installed = true

      # Install our patch that logs SQL queries
      ActiveRecord::ConnectionAdapters::Mysql2Adapter.prepend(Monkeypatches::Query)

      # Install our patch that enables a `with_tag` method on AR calls
      ActiveRecord::Relation.prepend(Monkeypatches::Tagger)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
active_record-sql_analyzer-0.3.0 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.2.3 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.2.2 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.2.1 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.2.0 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.1.0 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.0.8 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.0.7 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.0.6 lib/active_record/sql_analyzer.rb
active_record-sql_analyzer-0.0.5 lib/active_record/sql_analyzer.rb