Skip to content

Commit

Permalink
add configuration for using a custom ObjectFactory
Browse files Browse the repository at this point in the history
this is a first step toward #672 and valkyrie support. we want to be able to
drop in an ObjectFactory implementation that finds and saves using Valkyrie
instead of ActiveFedora.
  • Loading branch information
tamsin johnson committed Nov 17, 2022
1 parent a2525f7 commit 05cca30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/bulkrax/import_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def active_id_for_authority?(value, field)
end

def factory
@factory ||= Bulkrax::ObjectFactory.new(attributes: self.parsed_metadata,
@factory ||= Bulkrax.object_factory.new(attributes: self.parsed_metadata,
source_identifier_value: identifier,
work_identifier: parser.work_identifier,
related_parents_parsed_mapping: parser.related_parents_parsed_mapping,
Expand Down
1 change: 1 addition & 0 deletions lib/bulkrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class << self
:import_path,
:multi_value_element_join_on,
:multi_value_element_split_on,
:object_factory,
:parsers,
:qa_controlled_properties,
:related_children_field_mapping,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Default is the first returned by Hyrax.config.curation_concerns
# config.default_work_type = MyWork

# Factory Class to use when generating and saving objects
config.object_factory = Bulkrax::ObjectFactory

# Path to store pending imports
# config.import_path = 'tmp/imports'

Expand Down

0 comments on commit 05cca30

Please sign in to comment.