Class: PublicActivity::ORM::ActiveRecord::Adapter

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

Overview

Provides ActiveRecord specific, database-related routines for use by PublicActivity.

Class Method Summary collapse

Class Method Details

.create_activity(trackable, options) ⇒ Object

Creates the activity on `trackable` with `options`


12
13
14
# File 'lib/public_activity/orm/active_record/adapter.rb', line 12

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


17
18
19
# File 'lib/public_activity/orm/active_record/adapter.rb', line 17

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