Add rate limit for editing (#17728)
This commit is contained in:
parent
803f536cdd
commit
b2cd34474b
5 changed files with 11 additions and 5 deletions
|
@ -17,6 +17,8 @@
|
|||
#
|
||||
|
||||
class StatusEdit < ApplicationRecord
|
||||
include RateLimitable
|
||||
|
||||
self.ignored_columns = %w(
|
||||
media_attachments_changed
|
||||
)
|
||||
|
@ -26,6 +28,8 @@ class StatusEdit < ApplicationRecord
|
|||
delegate :id, :type, :url, :preview_url, :remote_url, :preview_remote_url, :text_url, :meta, :blurhash, to: :media_attachment
|
||||
end
|
||||
|
||||
rate_limit by: :account, family: :statuses
|
||||
|
||||
belongs_to :status
|
||||
belongs_to :account, optional: true
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue