Add collection reach finder (#39346)
This commit is contained in:
1 parent
4ee893461d
commit
200fda1cdc
19 files changed
+98
-20
No files matched your search
@@ -32,6 +32,7 @@ class Collection < ApplicationRecord
|
||||
has_many :collection_items, dependent: :delete_all
|
||||
has_many :accepted_collection_items, -> { accepted }, class_name: 'CollectionItem', inverse_of: :collection # rubocop:disable Rails/HasManyOrHasOneDependent
|
||||
has_many :collection_reports, dependent: :delete_all
|
||||
has_many :accounts, -> { merge(CollectionItem.pending_or_accepted) }, through: :collection_items
|
||||
|
||||
validates :name, presence: true
|
||||
validates :name, length: { maximum: 40 }, if: :local?
|
||||
|
||||
Reference in new issue
Block a user