Code Explainers

Code explainers tagged #auditing

ruby
class Current < ActiveSupport::CurrentAttributes
  attribute :user, :request_id, :user_agent, :ip_address
 
  resets { Time.zone = nil }

Per-request audit trails with Current in Rails

thread-local-state auditing concerns
Intermediate 8 steps
java
package com.acme.catalog.persistence;
 
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;

Auditing timestamps with a JPA MappedSuperclass in Spring

jpa auditing lifecycle-callbacks
Intermediate 5 steps
ruby
class Admin::AccountsController < Admin::BaseController
  before_action :set_account, only: :destroy
 
  def destroy

A guarded destroy action in Rails

controllers callbacks transactions
Intermediate 8 steps