module ActionController::RateLimiting
Private Instance Methods
rate_limiting(to:, within:, by:, with:, store:, name:)
click to toggle source
# File lib/action_controller/metal/rate_limiting.rb, line 61 def rate_limiting(to:, within:, by:, with:, store:, name:) cache_key = ["rate-limit", controller_path, name, instance_exec(&by)].compact.join(":") count = store.increment(cache_key, 1, expires_in: within) if count && count > to ActiveSupport::Notifications.instrument("rate_limit.action_controller", request: request) do instance_exec(&with) end end end