1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/main' into upstream-20240326

This commit is contained in:
KMY 2024-03-26 09:08:20 +09:00
commit 6c9b221cb2
263 changed files with 4628 additions and 1518 deletions

View file

@ -73,6 +73,9 @@ class Notification < ApplicationRecord
warning: {
filterable: false,
}.freeze,
severed_relationships: {
filterable: false,
}.freeze,
'admin.sign_up': {
filterable: false,
}.freeze,
@ -113,6 +116,7 @@ class Notification < ApplicationRecord
belongs_to :poll, inverse_of: false
belongs_to :report, inverse_of: false
belongs_to :account_warning, inverse_of: false
belongs_to :account_relationship_severance_event, inverse_of: false
end
validates :type, inclusion: { in: TYPES }
@ -230,6 +234,11 @@ class Notification < ApplicationRecord
self.from_account_id = activity&.status&.account_id
when 'Account'
self.from_account_id = activity&.id
when 'AccountRelationshipSeveranceEvent'
# These do not really have an originating account, but this is mandatory
# in the data model, and the recipient's account will by definition
# always exist
self.from_account_id = account_id
end
end