Module: DedupeRequests::Controller

Extended by:
ActiveSupport::Concern
Defined in:
lib/dedupe_requests/controller.rb

Overview

Rails controller integration.

class ApplicationController < ActionController::Base
  include DedupeRequests::Controller
  dedupe_requests on: %i[create update]
end

Registers a SINGLE around_action that, for each guarded action, claims before the action runs and releases on a 4xx/5xx response or a raised exception (2xx/3xx keep the claim). The guarded actions and their per-action TTLs live in an inherited class_attribute map, so subclasses extend or trim it.