Module: LogBook

Defined in:
lib/log_book.rb,
lib/log_book/version.rb

Defined Under Namespace

Modules: Plugin, Utils Classes: Event, MigrationGenerator

Constant Summary collapse

OPERATIONS =
{
  :create => "create",
  :update => "update",
  :destroy => "destroy"
}
VERSION =
"0.1.7"

Class Method Summary collapse

Class Method Details

.event(historian, historizable, text, tag_list) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/log_book.rb', line 16

def self.event(historian, historizable, text, tag_list)
  tag_list_composed = []
  tag_list_composed << scope_tag(historian)   if historian
  tag_list_composed << kind_tag(historizable) if historizable
  tag_list_composed += [tag_list].flatten     if tag_list
  
  LogBook::Event.create!(
    :historian => historian,
    :historizable => historizable,
    :text => text,
    :tag_list => tag_list_composed
  )
end