diff --git a/app/models/collection.rb b/app/models/collection.rb index b2982d0c..961910c0 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -2,8 +2,15 @@ # Generated by hyrax:models class Collection < ActiveFedora::Base + # this is the unique identifier bulkrax uses for import. + # this property only needs to be added to the model so it can be saved for works. + # it will not show in the public view for users, and cannot be entered manually via the edit work form. + property :source_identifier, predicate: ::RDF::URI.new("https://atla.com/terms/sourceIdentifier"), multiple: false + include ::Hyrax::CollectionBehavior # You can replace these metadata if they're not suitable + # This must come after the properties because it finalizes the metadata + # schema (by adding accepts_nested_attributes) include Hyrax::BasicMetadata self.indexer = CollectionIndexer after_update :remove_featured, if: proc { |collection| collection.private? } @@ -12,9 +19,4 @@ class Collection < ActiveFedora::Base def remove_featured FeaturedCollection.where(collection_id: id).destroy_all end - - # this is the unique identifier bulkrax uses for import. - # this property only needs to be added to the model so it can be saved for works. - # it will not show in the public view for users, and cannot be entered manually via the edit work form. - property :source_identifier, predicate: ::RDF::URI.new("https://atla.com/terms/sourceIdentifier"), multiple: false end