Class: AuditRecordSweeper

Inherits:
ActionController::Caching::Sweeper
  • Object
show all
Defined in:
lib/auditable/audit_record_sweeper.rb

Instance Method Summary collapse

Instance Method Details

#before_create(audit_record) ⇒ Object



3
4
5
6
# File 'lib/auditable/audit_record_sweeper.rb', line 3

def before_create(audit_record)
  audit_record.user_id ||= current_user.id
  audit_record.remote_address = controller.try(:request).try(:ip)
end