Skip to content

Commit

Permalink
πŸ› Fix Bulkrax Collection Relationships job
Browse files Browse the repository at this point in the history
Importing a work with a collection did not add the work to the
collection. By moving the Hyrax::BasicMetadata include below the
property definition, the relationship job now completes normally and
makes the appropriate relationships.

refs
- #195
  • Loading branch information
LaRita Robinson committed Nov 27, 2023
1 parent f6109d4 commit 51b62bc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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? }
Expand All @@ -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

0 comments on commit 51b62bc

Please sign in to comment.