Module: Weasel

Defined in:
lib/weasel.rb,
lib/weasel/version.rb,
lib/weasel/models/event.rb,
lib/weasel/concerns/auditable.rb,
lib/weasel/workers/events_worker.rb

Defined Under Namespace

Modules: Auditable Classes: Configuration, Event, EventsWorker

Constant Summary collapse

VERSION =
"3.0.2"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configObject



18
19
20
# File 'lib/weasel.rb', line 18

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

.configure {|config| ... } ⇒ Object

Yields:



22
23
24
25
26
27
28
29
30
31
# File 'lib/weasel.rb', line 22

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

.rootObject



10
11
12
# File 'lib/weasel.rb', line 10

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

Instance Method Details

#audit_with_weasel(*args) ⇒ Object



2
3
4
# File 'lib/weasel/concerns/auditable.rb', line 2

def audit_with_weasel(*args)
  around_action :audit, only: args
end