Fix collections allowing multiple occurrences of the same user (#38636)
This commit is contained in:
1 parent
7b343c9567
commit
06a8379dce
3 files changed
+44
-2
No files matched your search
@@ -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? }
|
||||
|
||||
Reference in new issue
Block a user