Sha256: 8e1a0174a96c6793d72e99ff74ad368289233c4c05026c128ecd5a2f824a11f7

Contents?: true

Size: 672 Bytes

Versions: 2

Compression:

Stored size: 672 Bytes

Contents

require_relative 'sojourn/version'
require_relative 'sojourn/configuration'
require_relative 'sojourn/controller'

module Sojourn
  def self.table_name_prefix
    'sojourn_'
  end

  def self.configure(&block)
    block.call(config)
  end

  def self.config
    @config ||= Configuration.new
  end

  def self.tables_exist?
    @tables_exist ||= %w(sojourn_events sojourn_requests)
                      .map { |t| ActiveRecord::Base.connection.table_exists?(t) }.all?
  end

  def self.track_raw_event!(name, properties)
    Event.create! sojourner_uuid: '!unknown', name: name, properties: properties
  end
end

ActionController::Base.send :include, Sojourn::Controller

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sojourn-0.1.1 lib/sojourn.rb
sojourn-0.1.0 lib/sojourn.rb