Skip to content

Commit 10a34b7

Browse files
committed
Touch up the AC::RateLimiting documentation
1 parent 1205a75 commit 10a34b7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

actionpack/lib/action_controller/metal/rate_limiting.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module ClassMethods
1616
# in the <tt>with:</tt> parameter. It's evaluated within the context of the controller processing the request.
1717
#
1818
# Rate limiting relies on a backing <tt>ActiveSupport::Cache</tt> store and defaults to <tt>config.action_controller.cache_store</tt>, which
19-
# itself default to the global `config.cache_store`. If you don't want to store rate limits in the same datastore than your general caches
19+
# itself default to the global <tt>config.cache_store</tt>. If you don't want to store rate limits in the same datastore than your general caches
2020
# you can pass a custom store in the <tt>store</tt> parameter.
2121
#
2222
# Examples:
@@ -34,8 +34,6 @@ module ClassMethods
3434
# RATE_LIMIT_STORE = ActiveSupport::Cache::RedisCacheStore.new(url: ENV["REDIS_URL"])
3535
# rate_limit to: 10, within: 3.minutes, store: RATE_LIMIT_STORE
3636
# end
37-
#
38-
# TODO Note
3937
def rate_limit(to:, within:, by: -> { request.remote_ip }, with: -> { head :too_many_requests }, store: cache_store, **options)
4038
before_action -> { rate_limiting(to: to, within: within, by: by, with: with, store: store) }, **options
4139
end

0 commit comments

Comments
 (0)