Sha256: b3f3655064ddea8bec9dffcf4fa5a9e4a71c8761242232f72def3fece4601734

Contents?: true

Size: 530 Bytes

Versions: 6

Compression:

Stored size: 530 Bytes

Contents

require 'sql_tracker/config'
require 'sql_tracker/handler'
require 'sql_tracker/report'

module SqlTracker
  def self.initialize!
    raise 'sql tracker initialized twice' if @already_initialized

    config = SqlTracker::Config.apply_defaults
    handler = SqlTracker::Handler.new(config)
    ActiveSupport::Notifications.subscribe('sql.active_record', handler)
    @already_initialized = true

    at_exit { handler.save }
  end
end

if defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i >= 3
  require 'sql_tracker/railtie'
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sql_tracker-1.2.1 lib/sql_tracker.rb
sql_tracker-1.2.0 lib/sql_tracker.rb
sql_tracker-1.1.1 lib/sql_tracker.rb
sql_tracker-1.1.0 lib/sql_tracker.rb
sql_tracker-1.0.1 lib/sql_tracker.rb
sql_tracker-1.0.0 lib/sql_tracker.rb