Module: Wonkavision::Mongoid::Activity::ClassMethods

Includes:
ActsAsOompaLoompa
Defined in:
lib/wonkavision/persistence/mongoid_adapter.rb

Instance Method Summary collapse

Methods included from ActsAsOompaLoompa

#acts_as_business_activity, #acts_as_event_handler, #acts_as_timeline, #acts_like_a_child

Instance Method Details

#define_document_key(key_name, key_type, options = {}) ⇒ Object



13
14
15
16
# File 'lib/wonkavision/persistence/mongoid_adapter.rb', line 13

def define_document_key(key_name,key_type,options={})
  options[:type] = key_type
  field(key_name,  options) unless fields[key_name]
end

#find_activity_instance(correlation_field_name, correlation_id) ⇒ Object



23
24
25
# File 'lib/wonkavision/persistence/mongoid_adapter.rb', line 23

def find_activity_instance(correlation_field_name,correlation_id)
  self.find_or_create_by({correlation_field_name=>correlation_id})
end

#update_activity(activity, event_data) ⇒ Object



18
19
20
21
# File 'lib/wonkavision/persistence/mongoid_adapter.rb', line 18

def update_activity(activity,event_data)
  activity.write_attributes(event_data)
  :updated
end