bulkrax 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/factories/bulkrax/object_factory.rb +2 -1
- data/app/jobs/bulkrax/create_relationships_job.rb +1 -1
- data/app/models/bulkrax/importer_run.rb +2 -1
- data/app/models/bulkrax/pending_relationship.rb +1 -1
- data/app/models/concerns/bulkrax/import_behavior.rb +2 -2
- data/app/parsers/bulkrax/application_parser.rb +1 -0
- data/db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb +7 -0
- data/lib/bulkrax/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2525e4aed8b31a897668d556c311b29189ec1b7a951b4303604acd3ccb11fcc8
|
4
|
+
data.tar.gz: d642de2af38c8c82108b113641ab1e191ae05b96b2ce3528dde7d7c908639291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6547c0283f75626cda95a8cc09cceff84ac576b7ca4034b72d729ab16d50c71657dac0e78739b5ef6f2d83aa85e1ddc8c45646f6c44408a0a989b4b33b93c487
|
7
|
+
data.tar.gz: 9ae11d35d0b3caf9d45237590e42541c0004268e6c86e8d44e6754900b253894813c7e817b471ed9379b7eefad1ec3a27d2cfebbe94865727ecb69b6b8652480
|
@@ -61,6 +61,7 @@ module Bulkrax
|
|
61
61
|
work_actor.update(environment(attrs))
|
62
62
|
end
|
63
63
|
end
|
64
|
+
object.apply_depositor_metadata(@user) && object.save! if object.depositor.nil?
|
64
65
|
log_updated(object)
|
65
66
|
end
|
66
67
|
|
@@ -107,6 +108,7 @@ module Bulkrax
|
|
107
108
|
end
|
108
109
|
end
|
109
110
|
end
|
111
|
+
object.apply_depositor_metadata(@user) && object.save! if object.depositor.nil?
|
110
112
|
log_created(object)
|
111
113
|
end
|
112
114
|
|
@@ -141,7 +143,6 @@ module Bulkrax
|
|
141
143
|
attrs = clean_attrs(attrs)
|
142
144
|
attrs = collection_type(attrs)
|
143
145
|
object.attributes = attrs
|
144
|
-
object.apply_depositor_metadata(@user)
|
145
146
|
object.save!
|
146
147
|
end
|
147
148
|
|
@@ -33,7 +33,7 @@ module Bulkrax
|
|
33
33
|
# is the child in the relationship, and vice versa if a child_identifier is passed.
|
34
34
|
def perform(parent_identifier:, importer_run_id:) # rubocop:disable Metrics/AbcSize
|
35
35
|
pending_relationships = Bulkrax::PendingRelationship.find_each.select do |rel|
|
36
|
-
rel.
|
36
|
+
rel.importer_run_id == importer_run_id && rel.parent_id == parent_identifier
|
37
37
|
end.sort_by(&:order)
|
38
38
|
|
39
39
|
@importer_run_id = importer_run_id
|
@@ -4,9 +4,10 @@ module Bulkrax
|
|
4
4
|
class ImporterRun < ApplicationRecord
|
5
5
|
belongs_to :importer
|
6
6
|
has_many :statuses, as: :runnable, dependent: :destroy
|
7
|
+
has_many :pending_relationships, dependent: :destroy
|
7
8
|
|
8
9
|
def parents
|
9
|
-
|
10
|
+
pending_relationships.pluck(:parent_id).uniq
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -50,7 +50,7 @@ module Bulkrax
|
|
50
50
|
self.parsed_metadata[related_parents_parsed_mapping].each do |parent_identifier|
|
51
51
|
next if parent_identifier.blank?
|
52
52
|
|
53
|
-
PendingRelationship.create!(child_id: self.identifier, parent_id: parent_identifier,
|
53
|
+
PendingRelationship.create!(child_id: self.identifier, parent_id: parent_identifier, importer_run_id: importerexporter.last_run.id, order: self.id)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -58,7 +58,7 @@ module Bulkrax
|
|
58
58
|
self.parsed_metadata[related_children_parsed_mapping].each do |child_identifier|
|
59
59
|
next if child_identifier.blank?
|
60
60
|
|
61
|
-
PendingRelationship.create!(parent_id: self.identifier, child_id: child_identifier,
|
61
|
+
PendingRelationship.create!(parent_id: self.identifier, child_id: child_identifier, importer_run_id: importerexporter.last_run.id, order: self.id)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class RenameBulkraxImporterRunToImporterRun < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
if column_exists?(:bulkrax_pending_relationships, :bulkrax_importer_run_id)
|
4
|
+
rename_column :bulkrax_pending_relationships, :bulkrax_importer_run_id, :importer_run_id
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
data/lib/bulkrax/version.rb
CHANGED
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: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -374,6 +374,7 @@ files:
|
|
374
374
|
- db/migrate/20220303212810_add_order_to_bulkrax_pending_relationships.rb
|
375
375
|
- db/migrate/20220412233954_add_include_thumbnails_to_bulkrax_exporters.rb
|
376
376
|
- db/migrate/20220413180915_add_generated_metadata_to_bulkrax_exporters.rb
|
377
|
+
- db/migrate/20220609001128_rename_bulkrax_importer_run_to_importer_run.rb
|
377
378
|
- lib/bulkrax.rb
|
378
379
|
- lib/bulkrax/engine.rb
|
379
380
|
- lib/bulkrax/version.rb
|
@@ -389,7 +390,7 @@ homepage: https://github.com/samvera-labs/bulkrax
|
|
389
390
|
licenses:
|
390
391
|
- Apache-2.0
|
391
392
|
metadata: {}
|
392
|
-
post_install_message:
|
393
|
+
post_install_message:
|
393
394
|
rdoc_options: []
|
394
395
|
require_paths:
|
395
396
|
- lib
|
@@ -404,8 +405,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
404
405
|
- !ruby/object:Gem::Version
|
405
406
|
version: '0'
|
406
407
|
requirements: []
|
407
|
-
rubygems_version: 3.
|
408
|
-
signing_key:
|
408
|
+
rubygems_version: 3.1.4
|
409
|
+
signing_key:
|
409
410
|
specification_version: 4
|
410
411
|
summary: Import and export tool for Hyrax and Hyku
|
411
412
|
test_files: []
|