Class: ActivityLogObserver

Inherits:
ActiveRecord::Observer
  • Object
show all
Defined in:
app/models/activity_log_observer.rb

Instance Method Summary collapse

Instance Method Details

#after_create(record) ⇒ Object



5
6
7
# File 'app/models/activity_log_observer.rb', line 5

def after_create(record)
  log_activity record, 'created', :created_by
end

#after_destroy(record) ⇒ Object



13
14
15
# File 'app/models/activity_log_observer.rb', line 13

def after_destroy(record)
  log_activity record, 'deleted', :deleted_by
end

#after_update(record) ⇒ Object



9
10
11
# File 'app/models/activity_log_observer.rb', line 9

def after_update(record)
  log_activity record, 'updated', :last_updated_by
end