about summary refs log tree commit diff
path: root/app/models/status_edit.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-03-09 20:06:51 +0100
committerGitHub <noreply@github.com>2022-03-09 20:06:51 +0100
commitb2cd34474b58b8a1f5e01ba73d236551dd0a878f (patch)
tree53e6abc10bd98ebd99d33ae51b67940734bd99fe /app/models/status_edit.rb
parent803f536cdd2e378146372976b64896a656ceec5b (diff)
Add rate limit for editing (#17728)
Diffstat (limited to 'app/models/status_edit.rb')
-rw-r--r--app/models/status_edit.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/status_edit.rb b/app/models/status_edit.rb
index 94a387c36..6da9b4b85 100644
--- a/app/models/status_edit.rb
+++ b/app/models/status_edit.rb
@@ -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