Module: StonePath::SPTask

Defined in:
lib/stonepath/task.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/stonepath/task.rb', line 8

def self.included(base)
  base.instance_eval do
    include AASM
  
    # Tasks are now completely polymorphic between workbenches.
    # as long as an activerecord model declares itself as a workbench and declares itself
    # a workbench for the specific kind of task, everything just works.
    belongs_to :workbench, :polymorphic => true
    
    # Tasks are now completely polymorphic between workitems.
    # as long as an activerecord model declares itself as a workitem and declares itself
    # a workitem for the specific kind of task, everything just works.
    belongs_to :workitem, :polymorphic => true
    
    #add the ability to log events if the user so specifies
    require File.expand_path(File.dirname(__FILE__)) + "/event_logging.rb"
    extend StonePath::EventLogging
    
    require File.expand_path(File.dirname(__FILE__)) + "/dot.rb"
    extend StonePath::Dot
    
  end
end