Disallow making private posts quotable (#35780)

This commit is contained in:
Claire 2025-08-14 15:58:25 +02:00 committed by GitHub
parent b0ce1ce49d
commit a2cddb9eac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View file

@ -10,6 +10,10 @@ module Status::InteractionPolicyConcern
followed: (1 << 3),
}.freeze
included do
before_validation :downgrade_quote_policy, if: -> { local? && !distributable? }
end
def quote_policy_as_keys(kind)
case kind
when :automatic
@ -52,4 +56,8 @@ module Status::InteractionPolicyConcern
:denied
end
def downgrade_quote_policy
self.quote_approval_policy = 0
end
end