Here’s a simple audit logging solution using an AuditLog ActiveRecord model with a polymorphic association, a Sidekiq worker, and an audit_log controller method. I wrote about the approach in Audit Logging in Rails.
AuditLog
audit_log
class AuditLogsController < ApplicationController def index @audit_logs = current_account.audit_logs.includes(:auditable, :user).order(created_at: :desc) end end
This solution logs events scoped to an account, and this controller shows how you might fetch all the audit logs for that account.