Sha256: 5cfb9624f52f25b7e6dc0df239c7dad5531b108086301056da2e98097690d504

Contents?: true

Size: 720 Bytes

Versions: 16

Compression:

Stored size: 720 Bytes

Contents

require 'active_record'
require 'active_support/concern'

require 'weasel/concerns/auditable'
require 'weasel/models/event'
require 'weasel/workers/events_worker'
require 'weasel/version'

module Weasel
  def self.root
    File.expand_path('../..', __FILE__)
  end

  class Configuration
    attr_accessor :db_configuration
  end

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

  def self.configure
    yield config

    # Connect to current AR connection.
    ActiveRecord::Base.establish_connection(config.db_configuration)

    # Extend ActionController with the `audit_with_weasel` method.
    ActionController::Base.extend(Weasel)
    ActionController::Base.send(:include, Weasel::Auditable)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
weasel-3.1.0 lib/weasel.rb
weasel-3.0.2 lib/weasel.rb
weasel-3.0.1 lib/weasel.rb
weasel-3.0.0 lib/weasel.rb
weasel-2.0.0 lib/weasel.rb
weasel-1.1.0 lib/weasel.rb
weasel-0.2.9 lib/weasel.rb
weasel-0.2.8 lib/weasel.rb
weasel-0.2.7 lib/weasel.rb
weasel-0.2.6 lib/weasel.rb
weasel-0.2.5 lib/weasel.rb
weasel-0.2.4 lib/weasel.rb
weasel-0.2.3 lib/weasel.rb
weasel-0.2.2 lib/weasel.rb
weasel-0.2.1 lib/weasel.rb
weasel-0.2.0 lib/weasel.rb