Only persist a collection item's approval URI once it is verified (#38255)

This commit is contained in:
David Roetzel authored and GitHub committed 2026-03-17 15:14:30 +00:00
1 parent b9d25bde3e
commit 96c93ba835
8 files changed
+24 -23

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ class CollectionItem < ApplicationRecord
validates :position, numericality: { only_integer: true, greater_than: 0 }
validates :activity_uri, presence: true, if: :local_item_with_remote_account?
validates :approval_uri, presence: true, unless: -> { local? || account&.local? }
validates :approval_uri, presence: true, unless: -> { local? || account&.local? || !accepted? }
validates :account, presence: true, if: :accepted?
validates :object_uri, presence: true, if: -> { account.nil? }
validates :uri, presence: true, if: :remote_item_with_remote_account?