Class: PublicActivity::ORM::Mongoid::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/public_activity/orm/mongoid/adapter.rb

Class Method Summary collapse

Class Method Details

.create_activity(trackable, options) ⇒ Object

Creates the activity on `trackable` with `options`


8
9
10
# File 'lib/public_activity/orm/mongoid/adapter.rb', line 8

def self.create_activity(trackable, options)
  trackable.activities.create options
end

.create_activity!(trackable, options) ⇒ Object

Creates activity on `trackable` with `options`; throws error on validation failure


13
14
15
# File 'lib/public_activity/orm/mongoid/adapter.rb', line 13

def self.create_activity!(trackable, options)
  trackable.activities.create! options
end