Class: AuditRecordSweeper
- Inherits:
-
ActionController::Caching::Sweeper
- Object
- ActionController::Caching::Sweeper
- AuditRecordSweeper
- 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 unless current_user.nil? audit_record.remote_address = controller.try(:request).try(:ip) end |