Fix collections allowing multiple occurrences of the same user (#38636)

This commit is contained in:
Claire authored and GitHub committed 2026-04-13 10:28:54 +00:00
1 parent 7b343c9567
commit 06a8379dce
3 files changed
+44 -2

No files matched your search

+1
View File
@@ -27,6 +27,7 @@ class CollectionItem < ApplicationRecord
delegate :local?, :remote?, to: :collection
validates :account_id, uniqueness: { scope: :collection_id }
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? || !accepted? }