bulkrax 3.0.0.beta7 → 3.0.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/parsers/bulkrax/csv_parser.rb +20 -12
- data/lib/bulkrax/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cfcae9e154506ea5b6699b530da3f2d370d478963de1cb5ce854db1e0ded3ed
|
4
|
+
data.tar.gz: 7b1511cbaad98ef523ac5c1f53442d0f568b7088aba2312df77e104c41c8e192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af73e975cd84be460ff29e2364a79e4fdae77793ca2a1b50534b8582e602138bd9c700af2068221907eee055f593f2305afab6d304385ba4f53e5ed72c64678f
|
7
|
+
data.tar.gz: 06bc7006d8b701dda2dd68487252e563f8b46484012124d5f81e43d3aa8af4916ba3c378948ad91157dce125768e2ea01e117673288fc8dbe1e9001cef03eb7e
|
@@ -23,20 +23,28 @@ module Bulkrax
|
|
23
23
|
@collections = []
|
24
24
|
@works = []
|
25
25
|
@file_sets = []
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
|
27
|
+
if model_field_mappings.map { |mfm| mfm.to_sym.in?(records.first.keys) }.any?
|
28
|
+
records.map do |r|
|
29
|
+
model_field_mappings.map(&:to_sym).each do |model_mapping|
|
30
|
+
next unless r.key?(model_mapping)
|
31
|
+
|
32
|
+
if r[model_mapping].casecmp('collection').zero?
|
33
|
+
@collections << r
|
34
|
+
elsif r[model_mapping].casecmp('fileset').zero?
|
35
|
+
@file_sets << r
|
36
|
+
else
|
37
|
+
@works << r
|
38
|
+
end
|
34
39
|
end
|
35
40
|
end
|
41
|
+
@collections = @collections.flatten.compact.uniq
|
42
|
+
@file_sets = @file_sets.flatten.compact.uniq
|
43
|
+
@works = @works.flatten.compact.uniq
|
44
|
+
else # if no model is specified, assume all records are works
|
45
|
+
@works = records.flatten.compact.uniq
|
36
46
|
end
|
37
|
-
|
38
|
-
@file_sets = @file_sets.flatten.compact.uniq
|
39
|
-
@works = @works.flatten.compact.uniq
|
47
|
+
|
40
48
|
true
|
41
49
|
end
|
42
50
|
|
@@ -110,7 +118,7 @@ module Bulkrax
|
|
110
118
|
|
111
119
|
def create_objects(types_array = nil)
|
112
120
|
index = 0
|
113
|
-
(types_array || %w[work
|
121
|
+
(types_array || %w[collection work file_set relationship]).each do |type|
|
114
122
|
if type.eql?('relationship')
|
115
123
|
ScheduleRelationshipsJob.set(wait: 5.minutes).perform_later(importer_id: importerexporter.id)
|
116
124
|
next
|
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.0.0.
|
4
|
+
version: 3.0.0.beta8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|