bulkrax 5.5.1 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d047869e323f1c300329fa46b3cb0bcc4e0f3975729d44c66554d79f00f41657
4
- data.tar.gz: 0d80b53d7b490bfe39bf8148f926cd2aa9e73f22f1e5a5726f225c11f72b6856
3
+ metadata.gz: 27625a6224b5a9a1f395e6e0ef8b7169fdfcf497b2fcd4268b760ed6d1c0444a
4
+ data.tar.gz: 2bdaba078e12824c62afb300ecf054d9299705b735acd552a86af3296e7e4599
5
5
  SHA512:
6
- metadata.gz: 0e03981be6998e66998c33484afb06aead0e18984bc7a75320aef9078cfec8ce419203b3d90b93cad3193bb7f9187ad3a8906291690d791dac66f07a42144ee2
7
- data.tar.gz: 4a66439b1b28aa601ef36425b440a29b8796589d4fe2c74f759e066768564cc3656cb1de290e1df89fb45d28ec6926e0d3a67936c990619057028f7701822177
6
+ metadata.gz: a5b037670580f6ae08a0a7cb810a4d11020d61baeeabe53aa17540767ae36385c72b0b3b1d953a73bd5a7a7bb7c979182db7b6c98f588fe362ae955b1a1c32ab
7
+ data.tar.gz: 7948683559e6ba2b5c1bc221ebcc6f5b10b674cf014baa1ff355baa7cfffc487148a701aa198572777c6a19457b13969156200ea02b8c74b79030a70bef6ddc9
@@ -241,7 +241,7 @@ module Bulkrax
241
241
  end
242
242
 
243
243
  def list_external_sets
244
- url = params[:base_url] || (@harvester ? @harvester.base_url : nil)
244
+ url = params[:base_url] || @harvester&.base_url
245
245
  setup_client(url) if url.present?
246
246
 
247
247
  @sets = [['All', 'all']]
@@ -28,15 +28,16 @@ module Bulkrax
28
28
  class_attribute :transformation_removes_blank_hash_values, default: false
29
29
 
30
30
  define_model_callbacks :save, :create
31
- attr_reader :attributes, :object, :source_identifier_value, :klass, :replace_files, :update_files, :work_identifier, :related_parents_parsed_mapping, :importer_run_id
31
+ attr_reader :attributes, :object, :source_identifier_value, :klass, :replace_files, :update_files, :work_identifier, :work_identifier_search_field, :related_parents_parsed_mapping, :importer_run_id
32
32
 
33
33
  # rubocop:disable Metrics/ParameterLists
34
- def initialize(attributes:, source_identifier_value:, work_identifier:, related_parents_parsed_mapping: nil, replace_files: false, user: nil, klass: nil, importer_run_id: nil, update_files: false)
34
+ def initialize(attributes:, source_identifier_value:, work_identifier:, work_identifier_search_field:, related_parents_parsed_mapping: nil, replace_files: false, user: nil, klass: nil, importer_run_id: nil, update_files: false)
35
35
  @attributes = ActiveSupport::HashWithIndifferentAccess.new(attributes)
36
36
  @replace_files = replace_files
37
37
  @update_files = update_files
38
38
  @user = user || User.batch_user
39
39
  @work_identifier = work_identifier
40
+ @work_identifier_search_field = work_identifier_search_field
40
41
  @related_parents_parsed_mapping = related_parents_parsed_mapping
41
42
  @source_identifier_value = source_identifier_value
42
43
  @klass = klass || Bulkrax.default_work_type.constantize
@@ -103,12 +104,7 @@ module Bulkrax
103
104
  end
104
105
 
105
106
  def search_by_identifier
106
- # TODO(alishaevn): return the proper `work_index` value below
107
- # ref: https://github.com/samvera-labs/bulkrax/issues/866
108
- # ref:https://github.com/samvera-labs/bulkrax/issues/867
109
- # work_index = ::ActiveFedora.index_field_mapper.solr_name(work_identifier, :facetable)
110
- work_index = work_identifier
111
- query = { work_index =>
107
+ query = { work_identifier_search_field =>
112
108
  source_identifier_value }
113
109
  # Query can return partial matches (something6 matches both something6 and something68)
114
110
  # so we need to weed out any that are not the correct full match. But other items might be
@@ -40,7 +40,7 @@ module Bulkrax
40
40
 
41
41
  include DynamicRecordLookup
42
42
 
43
- queue_as Bulkrax.config.ingest_queue_name
43
+ queue_as :import
44
44
 
45
45
  # @param parent_identifier [String] Work/Collection ID or Bulkrax::Entry source_identifiers
46
46
  # @param importer_run [Bulkrax::ImporterRun] current importer run (needed to properly update counters)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Bulkrax
4
4
  class DeleteJob < ApplicationJob
5
- queue_as Bulkrax.config.ingest_queue_name
5
+ queue_as :import
6
6
 
7
7
  def perform(entry, importer_run)
8
8
  obj = entry.factory.find
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Bulkrax
4
4
  class DownloadCloudFileJob < ApplicationJob
5
- queue_as Bulkrax.config.ingest_queue_name
5
+ queue_as :import
6
6
 
7
7
  # Retrieve cloud file and write to the imports directory
8
8
  # Note: if using the file system, the mounted directory in
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Bulkrax
4
4
  class ImportCollectionJob < ApplicationJob
5
- queue_as Bulkrax.config.ingest_queue_name
5
+ queue_as :import
6
6
 
7
7
  # rubocop:disable Rails/SkipsModelValidations
8
8
  def perform(*args)
@@ -6,7 +6,7 @@ module Bulkrax
6
6
  class ImportFileSetJob < ApplicationJob
7
7
  include DynamicRecordLookup
8
8
 
9
- queue_as Bulkrax.config.ingest_queue_name
9
+ queue_as :import
10
10
 
11
11
  attr_reader :importer_run_id
12
12
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Bulkrax
4
4
  class ImportWorkJob < ApplicationJob
5
- queue_as Bulkrax.config.ingest_queue_name
5
+ queue_as :import
6
6
 
7
7
  # rubocop:disable Rails/SkipsModelValidations
8
8
  #
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Bulkrax
4
4
  class ImporterJob < ApplicationJob
5
- queue_as Bulkrax.config.ingest_queue_name
5
+ queue_as :import
6
6
 
7
7
  def perform(importer_id, only_updates_since_last_import = false)
8
8
  importer = Importer.find(importer_id)
@@ -179,6 +179,7 @@ module Bulkrax
179
179
  @factory ||= of.new(attributes: self.parsed_metadata,
180
180
  source_identifier_value: identifier,
181
181
  work_identifier: parser.work_identifier,
182
+ work_identifier_search_field: parser.work_identifier_search_field,
182
183
  related_parents_parsed_mapping: parser.related_parents_parsed_mapping,
183
184
  replace_files: replace_files,
184
185
  user: user,
@@ -81,6 +81,13 @@ module Bulkrax
81
81
  @work_identifier ||= get_field_mapping_hash_for('source_identifier')&.keys&.first&.to_sym || :source
82
82
  end
83
83
 
84
+ # @return [Symbol] the solr property of the source_identifier. Used for searching.
85
+ # defaults to work_identifier value + "_sim"
86
+ # @see #work_identifier
87
+ def work_identifier_search_field
88
+ @work_identifier_search_field ||= get_field_mapping_hash_for('source_identifier')&.values&.first&.[]('search_field')&.first&.to_s || "#{work_identifier}_sim"
89
+ end
90
+
84
91
  # @return [String]
85
92
  def generated_metadata_mapping
86
93
  @generated_metadata_mapping ||= 'generated'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bulkrax
4
- VERSION = '5.5.1'
4
+ VERSION = '6.0.0'
5
5
  end
data/lib/bulkrax.rb CHANGED
@@ -1,16 +1,16 @@
1
- # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
- require "bulkrax/version"
4
- require "bulkrax/engine"
5
- require 'active_support/all'
3
+ require "bulkrax/version"
4
+ require "bulkrax/engine"
5
+ require 'active_support/all'
6
6
 
7
- # rubocop:disable Metrics/ModuleLength
7
+ # rubocop:disable Metrics/ModuleLength
8
8
  module Bulkrax
9
- extend self # rubocop:disable Style/ModuleFunction
10
- extend Forwardable
9
+ extend self # rubocop:disable Style/ModuleFunction
10
+ extend Forwardable
11
11
 
12
- ##
13
- # @api public
12
+ ##
13
+ # @api public
14
14
  class Configuration
15
15
  attr_accessor :api_definition,
16
16
  :curation_concerns,
@@ -35,15 +35,6 @@ module Bulkrax
35
35
  :reserved_properties,
36
36
  :server_name
37
37
 
38
- attr_writer :ingest_queue_name
39
- ##
40
- # @return [String, Proc]
41
- def ingest_queue_name
42
- return @ingest_queue_name if @ingest_queue_name.present?
43
- return Hyrax.config.ingest_queue_name if defined?(Hyrax)
44
- :import
45
- end
46
-
47
38
  attr_writer :use_locking
48
39
 
49
40
  def use_locking
@@ -54,61 +45,61 @@ module Bulkrax
54
45
  alias use_locking? use_locking
55
46
  end
56
47
 
57
- def config
58
- @config ||= Configuration.new
59
- yield @config if block_given?
60
- @config
61
- end
62
- alias setup config
48
+ def config
49
+ @config ||= Configuration.new
50
+ yield @config if block_given?
51
+ @config
52
+ end
53
+ alias setup config
63
54
 
64
- def_delegators :@config,
65
- :api_definition,
66
- :api_definition=,
67
- :curation_concerns,
68
- :curation_concerns=,
69
- :default_field_mapping,
70
- :default_field_mapping=,
71
- :default_work_type,
72
- :default_work_type=,
73
- :export_path,
74
- :export_path=,
75
- :field_mappings,
76
- :field_mappings=,
77
- :file_model_class,
78
- :file_model_class=,
79
- :fill_in_blank_source_identifiers,
80
- :fill_in_blank_source_identifiers=,
81
- :generated_metadata_mapping,
82
- :generated_metadata_mapping=,
83
- :import_path,
84
- :import_path=,
85
- :multi_value_element_join_on,
86
- :multi_value_element_join_on=,
87
- :multi_value_element_split_on,
88
- :multi_value_element_split_on=,
89
- :object_factory,
90
- :object_factory=,
91
- :parsers,
92
- :parsers=,
93
- :qa_controlled_properties,
94
- :qa_controlled_properties=,
95
- :related_children_field_mapping,
96
- :related_children_field_mapping=,
97
- :related_parents_field_mapping,
98
- :related_parents_field_mapping=,
99
- :relationship_job_class,
100
- :relationship_job_class=,
101
- :removed_image_path,
102
- :removed_image_path=,
103
- :required_elements,
104
- :required_elements=,
105
- :reserved_properties,
106
- :reserved_properties=,
107
- :server_name,
108
- :server_name=,
109
- :use_locking,
110
- :use_locking=,
111
- :use_locking?
55
+ def_delegators :@config,
56
+ :api_definition,
57
+ :api_definition=,
58
+ :curation_concerns,
59
+ :curation_concerns=,
60
+ :default_field_mapping,
61
+ :default_field_mapping=,
62
+ :default_work_type,
63
+ :default_work_type=,
64
+ :export_path,
65
+ :export_path=,
66
+ :field_mappings,
67
+ :field_mappings=,
68
+ :file_model_class,
69
+ :file_model_class=,
70
+ :fill_in_blank_source_identifiers,
71
+ :fill_in_blank_source_identifiers=,
72
+ :generated_metadata_mapping,
73
+ :generated_metadata_mapping=,
74
+ :import_path,
75
+ :import_path=,
76
+ :multi_value_element_join_on,
77
+ :multi_value_element_join_on=,
78
+ :multi_value_element_split_on,
79
+ :multi_value_element_split_on=,
80
+ :object_factory,
81
+ :object_factory=,
82
+ :parsers,
83
+ :parsers=,
84
+ :qa_controlled_properties,
85
+ :qa_controlled_properties=,
86
+ :related_children_field_mapping,
87
+ :related_children_field_mapping=,
88
+ :related_parents_field_mapping,
89
+ :related_parents_field_mapping=,
90
+ :relationship_job_class,
91
+ :relationship_job_class=,
92
+ :removed_image_path,
93
+ :removed_image_path=,
94
+ :required_elements,
95
+ :required_elements=,
96
+ :reserved_properties,
97
+ :reserved_properties=,
98
+ :server_name,
99
+ :server_name=,
100
+ :use_locking,
101
+ :use_locking=,
102
+ :use_locking?
112
103
 
113
104
  config do |conf|
114
105
  conf.parsers = [
@@ -147,149 +138,149 @@ module Bulkrax
147
138
  # Based on Hyrax CoreMetadata && BasicMetadata
148
139
  # Override at application level to change
149
140
  conf.field_mappings = {
150
- "Bulkrax::OaiDcParser" => {
151
- "contributor" => { from: ["contributor"] },
152
- # no appropriate mapping for coverage (based_near needs id)
153
- # ""=>{:from=>["coverage"]},
154
- "creator" => { from: ["creator"] },
155
- "date_created" => { from: ["date"] },
156
- "description" => { from: ["description"] },
157
- # no appropriate mapping for format
158
- # ""=>{:from=>["format"]},
159
- "identifier" => { from: ["identifier"] },
160
- "language" => { from: ["language"], parsed: true },
161
- "publisher" => { from: ["publisher"] },
162
- "related_url" => { from: ["relation"] },
163
- "rights_statement" => { from: ["rights"] },
164
- "source" => { from: ["source"] },
165
- "subject" => { from: ["subject"], parsed: true },
166
- "title" => { from: ["title"] },
167
- "resource_type" => { from: ["type"], parsed: true },
168
- "remote_files" => { from: ["thumbnail_url"], parsed: true }
141
+ "Bulkrax::OaiDcParser" => {
142
+ "contributor" => { from: ["contributor"] },
143
+ # no appropriate mapping for coverage (based_near needs id)
144
+ # ""=>{:from=>["coverage"]},
145
+ "creator" => { from: ["creator"] },
146
+ "date_created" => { from: ["date"] },
147
+ "description" => { from: ["description"] },
148
+ # no appropriate mapping for format
149
+ # ""=>{:from=>["format"]},
150
+ "identifier" => { from: ["identifier"] },
151
+ "language" => { from: ["language"], parsed: true },
152
+ "publisher" => { from: ["publisher"] },
153
+ "related_url" => { from: ["relation"] },
154
+ "rights_statement" => { from: ["rights"] },
155
+ "source" => { from: ["source"] },
156
+ "subject" => { from: ["subject"], parsed: true },
157
+ "title" => { from: ["title"] },
158
+ "resource_type" => { from: ["type"], parsed: true },
159
+ "remote_files" => { from: ["thumbnail_url"], parsed: true }
169
160
  },
170
- "Bulkrax::OaiQualifiedDcParser" => {
171
- "abstract" => { from: ["abstract"] },
172
- "alternative_title" => { from: ["alternative"] },
161
+ "Bulkrax::OaiQualifiedDcParser" => {
162
+ "abstract" => { from: ["abstract"] },
163
+ "alternative_title" => { from: ["alternative"] },
173
164
  "bibliographic_citation" => { from: ["bibliographicCitation"] },
174
- "contributor" => { from: ["contributor"] },
175
- "creator" => { from: ["creator"] },
176
- "date_created" => { from: ["created"] },
177
- "description" => { from: ["description"] },
178
- "language" => { from: ["language"] },
179
- "license" => { from: ["license"] },
180
- "publisher" => { from: ["publisher"] },
181
- "related_url" => { from: ["relation"] },
182
- "rights_holder" => { from: ["rightsHolder"] },
183
- "rights_statement" => { from: ["rights"] },
184
- "source" => { from: ["source"] },
185
- "subject" => { from: ["subject"], parsed: true },
186
- "title" => { from: ["title"] },
187
- "resource_type" => { from: ["type"], parsed: true },
188
- "remote_files" => { from: ["thumbnail_url"], parsed: true }
189
- },
190
- # When empty, a default_field_mapping will be generated
191
- "Bulkrax::CsvParser" => {},
192
- 'Bulkrax::BagitParser' => {},
193
- 'Bulkrax::XmlParser' => {}
194
- }
165
+ "contributor" => { from: ["contributor"] },
166
+ "creator" => { from: ["creator"] },
167
+ "date_created" => { from: ["created"] },
168
+ "description" => { from: ["description"] },
169
+ "language" => { from: ["language"] },
170
+ "license" => { from: ["license"] },
171
+ "publisher" => { from: ["publisher"] },
172
+ "related_url" => { from: ["relation"] },
173
+ "rights_holder" => { from: ["rightsHolder"] },
174
+ "rights_statement" => { from: ["rights"] },
175
+ "source" => { from: ["source"] },
176
+ "subject" => { from: ["subject"], parsed: true },
177
+ "title" => { from: ["title"] },
178
+ "resource_type" => { from: ["type"], parsed: true },
179
+ "remote_files" => { from: ["thumbnail_url"], parsed: true }
180
+ },
181
+ # When empty, a default_field_mapping will be generated
182
+ "Bulkrax::CsvParser" => {},
183
+ 'Bulkrax::BagitParser' => {},
184
+ 'Bulkrax::XmlParser' => {}
185
+ }
195
186
 
196
- # Lambda to set the default field mapping
197
- conf.default_field_mapping = lambda do |field|
198
- return if field.blank?
199
- {
200
- field.to_s =>
201
- {
202
- from: [field.to_s],
203
- split: false,
204
- parsed: Bulkrax::ApplicationMatcher.method_defined?("parse_#{field}"),
205
- if: nil,
206
- excluded: false
207
- }
208
- }
209
- end
187
+ # Lambda to set the default field mapping
188
+ conf.default_field_mapping = lambda do |field|
189
+ return if field.blank?
190
+ {
191
+ field.to_s =>
192
+ {
193
+ from: [field.to_s],
194
+ split: false,
195
+ parsed: Bulkrax::ApplicationMatcher.method_defined?("parse_#{field}"),
196
+ if: nil,
197
+ excluded: false
198
+ }
199
+ }
200
+ end
210
201
 
211
- # Properties that should not be used in imports. They are reserved for use by Hyrax.
212
- conf.reserved_properties = %w[
213
- create_date
214
- modified_date
215
- date_modified
216
- date_uploaded
217
- depositor
218
- arkivo_checksum
219
- has_model
220
- head
221
- label
222
- import_url
223
- on_behalf_of
224
- proxy_depositor
225
- owner
226
- state
227
- tail
228
- original_url
229
- relative_path
230
- ]
202
+ # Properties that should not be used in imports. They are reserved for use by Hyrax.
203
+ conf.reserved_properties = %w[
204
+ create_date
205
+ modified_date
206
+ date_modified
207
+ date_uploaded
208
+ depositor
209
+ arkivo_checksum
210
+ has_model
211
+ head
212
+ label
213
+ import_url
214
+ on_behalf_of
215
+ proxy_depositor
216
+ owner
217
+ state
218
+ tail
219
+ original_url
220
+ relative_path
221
+ ]
231
222
 
232
- # List of Questioning Authority properties that are controlled via YAML files in
233
- # the config/authorities/ directory. For example, the :rights_statement property
234
- # is controlled by the active terms in config/authorities/rights_statements.yml
235
- conf.qa_controlled_properties = %w[rights_statement license]
236
- end
223
+ # List of Questioning Authority properties that are controlled via YAML files in
224
+ # the config/authorities/ directory. For example, the :rights_statement property
225
+ # is controlled by the active terms in config/authorities/rights_statements.yml
226
+ conf.qa_controlled_properties = %w[rights_statement license]
227
+ end
237
228
 
238
- def api_definition
239
- @api_definition ||= ActiveSupport::HashWithIndifferentAccess.new(
240
- YAML.safe_load(
241
- ERB.new(
242
- File.read(Rails.root.join('config', 'bulkrax_api.yml'))
243
- ).result
244
- )
245
- )
246
- end
229
+ def api_definition
230
+ @api_definition ||= ActiveSupport::HashWithIndifferentAccess.new(
231
+ YAML.safe_load(
232
+ ERB.new(
233
+ File.read(Rails.root.join('config', 'bulkrax_api.yml'))
234
+ ).result
235
+ )
236
+ )
237
+ end
247
238
 
248
- DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON = ' | '
249
- # Specify the delimiter for joining an attribute's multi-value array into a string.
250
- #
251
- # @note the specific delimiter should likely be present in the multi_value_element_split_on
252
- # expression.
253
- def multi_value_element_join_on
254
- @multi_value_element_join_on ||= DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON
255
- end
239
+ DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON = ' | '
240
+ # Specify the delimiter for joining an attribute's multi-value array into a string.
241
+ #
242
+ # @note the specific delimiter should likely be present in the multi_value_element_split_on
243
+ # expression.
244
+ def multi_value_element_join_on
245
+ @multi_value_element_join_on ||= DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON
246
+ end
256
247
 
257
- DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON = /\s*[:;|]\s*/.freeze
258
- # @return [RegexClass] the regular express to use to "split" an attribute's values. If set to
259
- # `true` use the DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON.
260
- #
261
- # @note The "true" value is to preserve backwards compatibility.
262
- # @see DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON
248
+ DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON = /\s*[:;|]\s*/.freeze
249
+ # @return [RegexClass] the regular express to use to "split" an attribute's values. If set to
250
+ # `true` use the DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON.
251
+ #
252
+ # @note The "true" value is to preserve backwards compatibility.
253
+ # @see DEFAULT_MULTI_VALUE_ELEMENT_JOIN_ON
263
254
  def multi_value_element_split_on
264
- if @multi_value_element_join_on.is_a?(TrueClass)
265
- DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON
255
+ if @multi_value_element_join_on.is_a?(TrueClass)
256
+ DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON
266
257
  else
267
- @multi_value_element_split_on ||= DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON
258
+ @multi_value_element_split_on ||= DEFAULT_MULTI_VALUE_ELEMENT_SPLIT_ON
268
259
  end
269
260
  end
270
261
 
271
- # Responsible for stripping hidden characters from the given string.
272
- #
273
- # @param value [#to_s]
274
- # @return [String] with hidden characters removed
275
- #
276
- # @see https://github.com/samvera-labs/bulkrax/issues/688
277
- def normalize_string(value)
278
- # Removing [Byte Order Mark (BOM)](https://en.wikipedia.org/wiki/Byte_order_mark)
279
- value.to_s.delete("\xEF\xBB\xBF")
280
- end
262
+ # Responsible for stripping hidden characters from the given string.
263
+ #
264
+ # @param value [#to_s]
265
+ # @return [String] with hidden characters removed
266
+ #
267
+ # @see https://github.com/samvera-labs/bulkrax/issues/688
268
+ def normalize_string(value)
269
+ # Removing [Byte Order Mark (BOM)](https://en.wikipedia.org/wiki/Byte_order_mark)
270
+ value.to_s.delete("\xEF\xBB\xBF")
271
+ end
281
272
 
282
- def fallback_user_for_importer_exporter_processing
283
- return User.batch_user if defined?(Hyrax) && User.respond_to?(:batch_user)
273
+ def fallback_user_for_importer_exporter_processing
274
+ return User.batch_user if defined?(Hyrax) && User.respond_to?(:batch_user)
284
275
 
285
- raise "We have no fallback user available for Bulkrax.fallback_user_for_importer_exporter_processing"
286
- end
276
+ raise "We have no fallback user available for Bulkrax.fallback_user_for_importer_exporter_processing"
277
+ end
287
278
 
288
- # This class confirms to the Active::Support.serialize interface. It's job is to ensure that we
289
- # don't have keys with the tricksy Byte Order Mark character.
290
- #
291
- # @see https://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize
292
- class NormalizedJson
279
+ # This class confirms to the Active::Support.serialize interface. It's job is to ensure that we
280
+ # don't have keys with the tricksy Byte Order Mark character.
281
+ #
282
+ # @see https://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize
283
+ class NormalizedJson
293
284
  def self.normalize_keys(hash)
294
285
  return hash unless hash.respond_to?(:each_pair)
295
286
  returning_value = {}
@@ -301,18 +292,18 @@ module Bulkrax
301
292
 
302
293
  # When we write the serialized data to the database, we "dump" the value into that database
303
294
  # column.
304
- def self.dump(value)
305
- JSON.dump(normalize_keys(value))
306
- end
295
+ def self.dump(value)
296
+ JSON.dump(normalize_keys(value))
297
+ end
307
298
 
308
299
  # When we load the serialized data from the database, we pass the database's value into "load"
309
300
  # function.
310
301
  #
311
302
  # rubocop:disable Security/JSONLoad
312
- def self.load(string)
313
- normalize_keys(JSON.load(string))
314
- end
303
+ def self.load(string)
304
+ normalize_keys(JSON.load(string))
305
+ end
315
306
  # rubocop:enable Security/JSONLoad
316
- end
307
+ end
317
308
  end
318
- # rubocop:disable Metrics/ModuleLength
309
+ # rubocop:disable Metrics/ModuleLength
@@ -47,7 +47,7 @@ Bulkrax.setup do |config|
47
47
  # (For more info on importing relationships, see Bulkrax Wiki: https://github.com/samvera-labs/bulkrax/wiki/Configuring-Bulkrax#parent-child-relationship-field-mappings)
48
48
  #
49
49
  # # e.g. to add the required source_identifier field
50
- # # config.field_mappings["Bulkrax::CsvParser"]["source_id"] = { from: ["old_source_id"], source_identifier: true }
50
+ # # config.field_mappings["Bulkrax::CsvParser"]["source_id"] = { from: ["old_source_id"], source_identifier: true, search_field: 'source_id_sim' }
51
51
  # If you want Bulkrax to fill in source_identifiers for you, see below
52
52
 
53
53
  # To duplicate a set of mappings from one parser to another
@@ -124,7 +124,7 @@ namespace :bulkrax do
124
124
  end
125
125
 
126
126
  def make_new_exports
127
- Bulkrax::Exporter.all.each { |e| Bulkrax::ExporterJob.perform_later(e.id) }
127
+ Bulkrax::Exporter.find_each { |e| Bulkrax::ExporterJob.perform_later(e.id) }
128
128
  rescue => e
129
129
  puts "(#{e.message})"
130
130
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulkrax
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Kaufman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2023-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails