Use attribute for defining rate_limit boolean (#35555)
This commit is contained in:
@@ -3,12 +3,8 @@
|
|||||||
module RateLimitable
|
module RateLimitable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def rate_limit=(value)
|
included do
|
||||||
@rate_limit = value
|
attribute :rate_limit, :boolean, default: false
|
||||||
end
|
|
||||||
|
|
||||||
def rate_limit?
|
|
||||||
@rate_limit
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def rate_limiter(by, options = {})
|
def rate_limiter(by, options = {})
|
||||||
|
|||||||
Reference in New Issue
Block a user