discourse/lib/edit_rate_limiter.rb

11 lines
228 B
Ruby
Raw Normal View History

require 'rate_limiter'
class EditRateLimiter < RateLimiter
def initialize(user)
2016-04-01 05:33:25 +08:00
super(user, "edit-post", SiteSetting.max_edits_per_day, 1.day.to_i)
end
def build_key(type)
"#{super(type)}:#{Date.today}"
end
end