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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c6719caedaf4adb707986e0b6771f1025ce1e08d0bf46afa78a85d99faded2b
4
- data.tar.gz: 7af41a63f79c6d9792066cf545f35bb723c7667970f0ea1e3a87c04dceda28d0
3
+ metadata.gz: 2525e4aed8b31a897668d556c311b29189ec1b7a951b4303604acd3ccb11fcc8
4
+ data.tar.gz: d642de2af38c8c82108b113641ab1e191ae05b96b2ce3528dde7d7c908639291
5
5
  SHA512:
6
- metadata.gz: 7ed10c67e81885b4ff3b40d2731b93b790495e19cad51fb9dfb0dcc5bebcd4c60fecc86fe0932f058d100a7937cedab43c1df050c98efd2107c086fdb2fd93a2
7
- data.tar.gz: 5a81d4cd7d0289b5d27a13876f20c29b0b40f0989ecbac7caaf26599a1cbdea5c27a2473f759783690562345e8b5d7c515a4f4a0f92d5241803897887e2e9214
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.bulkrax_importer_run_id == importer_run_id && rel.parent_id == parent_identifier
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
- PendingRelationship.where(bulkrax_importer_run_id: id).pluck(:parent_id).uniq
10
+ pending_relationships.pluck(:parent_id).uniq
10
11
  end
11
12
  end
12
13
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bulkrax
4
4
  class PendingRelationship < ApplicationRecord
5
- belongs_to :bulkrax_importer_run, class_name: "::Bulkrax::ImporterRun"
5
+ belongs_to :importer_run
6
6
  end
7
7
  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, bulkrax_importer_run_id: importerexporter.last_run.id, order: self.id)
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, bulkrax_importer_run_id: importerexporter.last_run.id, order: self.id)
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
 
@@ -261,6 +261,7 @@ module Bulkrax
261
261
  end
262
262
 
263
263
  def zip
264
+ require 'zip'
264
265
  FileUtils.rm_rf(exporter_export_zip_path)
265
266
  Zip::File.open(exporter_export_zip_path, create: true) do |zip_file|
266
267
  Dir["#{exporter_export_path}/**/**"].each do |file|
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bulkrax
4
- VERSION = '3.3.0'
4
+ VERSION = '3.3.1'
5
5
  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: 3.3.0
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-08 00:00:00.000000000 Z
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.0.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: []