enju_biblio 0.3.0 → 0.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
  SHA1:
3
- metadata.gz: 836cf0a1a87e3a07150b740a8e78cd7d5defab94
4
- data.tar.gz: 8fc7b9a482ac87b2331b6ac9fa4e86a6d5bdc8ad
3
+ metadata.gz: 9893d9b60d1b30b4a84d629dd3deb2b602329e2c
4
+ data.tar.gz: 8bfc7f9fffeca21b65ea21d64243acc030434dce
5
5
  SHA512:
6
- metadata.gz: 629db7eb1fa73ca8a465f4982bf86daa6f8f08711445e93e71d7f7e7df4cc7c40e22f4aafe945d7da5cb1436d3f12568a8856c40e9ba184d8f63fee2f5efb01b
7
- data.tar.gz: 72253f4984444ecc211b0291311efbd79d4cd279bf9af793488d11b63ee37773f18d60f0c048f592c44bc9d849865d84b8165d8b51f76ec96ddd37b82f30f1c6
6
+ metadata.gz: bcb3bd66a7b1af5678600f4e2810ace4d52bb24f5c968588808095e247cb276af20d1463cf519a96af693bb1b2957552d43dfdc50f754d745c6c8cdc982d158c
7
+ data.tar.gz: 66467ac7341fc55fa76bbee17ac70951a4d5aba6aa55afb05e766ef047a24d6d4bd774eb87486dc985479c5342dfd903faf19b3f7dd99cee54588ade11e66782
@@ -583,12 +583,15 @@ class Manifestation < ActiveRecord::Base
583
583
  end
584
584
  header += %w(
585
585
  circulation_status
586
- use_restriction
587
586
  shelf
588
587
  library
589
588
  item_created_at
590
589
  item_updated_at
591
590
  )
591
+ case role.to_sym
592
+ when :Administrator, :Librarian
593
+ header << "use_restriction"
594
+ end
592
595
 
593
596
  header.to_csv(options)
594
597
  end
@@ -678,11 +681,14 @@ class Manifestation < ActiveRecord::Base
678
681
  item_lines << Checkout.where(item_id: i.id).size
679
682
  end
680
683
  item_lines << i.circulation_status.try(:name)
681
- item_lines << i.use_restriction.try(:name)
682
684
  item_lines << i.shelf.name
683
685
  item_lines << i.shelf.library.name
684
686
  item_lines << i.created_at
685
687
  item_lines << i.updated_at
688
+ case options[:role].to_sym
689
+ when :Administrator, :Librarian
690
+ item_lines << i.use_restriction.try(:name)
691
+ end
686
692
  lines << item_lines
687
693
  end
688
694
  else
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -306,6 +306,19 @@ describe Manifestation, solr: true do
306
306
  expect(m["note"]).to eq 'test\ntest'
307
307
  expect(m["item_note"]).to eq 'test\ntest'
308
308
  end
309
+
310
+ it "should not export use_restriction for Guest" do
311
+ manifestation = FactoryBot.create(:manifestation)
312
+ use_restriction = UseRestriction.find(1)
313
+ item = FactoryBot.create(:item, manifestation: manifestation, use_restriction: use_restriction)
314
+ lines = Manifestation.export(format: :txt, role: "Guest")
315
+ csv = CSV.parse(lines, headers: true, col_sep: "\t")
316
+ expect(csv["use_restriction"].compact).to be_empty
317
+
318
+ lines = Manifestation.export(format: :txt, role: "Administrator")
319
+ csv = CSV.parse(lines, headers: true, col_sep: "\t")
320
+ expect(csv["use_restriction"].compact).not_to be_empty
321
+ end
309
322
  end
310
323
 
311
324
  if defined?(EnjuCirculation)
@@ -18,7 +18,7 @@ describe ResourceImportFile do
18
18
  old_items_count = Item.count
19
19
  old_agents_count = Agent.count
20
20
  old_import_results_count = ResourceImportResult.count
21
- @file.import_start.should eq({manifestation_imported: 9, item_imported: 9, manifestation_found: 6, item_found: 3, failed: 7})
21
+ @file.import_start.should eq({manifestation_imported: 10, item_imported: 10, manifestation_found: 6, item_found: 3, failed: 7})
22
22
  manifestation = Item.find_by(item_identifier: '11111').manifestation
23
23
  manifestation.publishers.first.full_name.should eq 'test4'
24
24
  manifestation.publishers.first.full_name_transcription.should eq 'てすと4'
@@ -26,11 +26,11 @@ describe ResourceImportFile do
26
26
  manifestation.produces.first.produce_type.name.should eq 'publisher'
27
27
  manifestation.creates.first.create_type.name.should eq 'author'
28
28
  manifestation.identifier_contents(:issn).should eq ['03875806']
29
- Manifestation.count.should eq old_manifestations_count + 9
30
- Item.count.should eq old_items_count + 9
29
+ Manifestation.count.should eq old_manifestations_count + 10
30
+ Item.count.should eq old_items_count + 10
31
31
  Agent.count.should eq old_agents_count + 9
32
32
  @file.resource_import_results.order(:id).first.body.split("\t").first.should eq 'manifestation_identifier'
33
- ResourceImportResult.count.should eq old_import_results_count + 22
33
+ ResourceImportResult.count.should eq old_import_results_count + 23
34
34
 
35
35
  manifestation_101 = Manifestation.find_by(manifestation_identifier: '101')
36
36
  manifestation_101.series_statements.count.should eq 1
@@ -39,6 +39,7 @@ describe ResourceImportFile do
39
39
  manifestation_101.series_statements.first.title_subseries.should eq '副シリーズ'
40
40
  manifestation_101.series_statements.first.title_subseries_transcription.should eq 'ふくしりーず'
41
41
  manifestation_101.items.order(:id).last.call_number.should eq '007|A'
42
+ manifestation_101.serial.should be_falsy
42
43
 
43
44
  item_10101 = Item.find_by(item_identifier: '10101')
44
45
  item_10101.manifestation.creators.size.should eq 2
@@ -115,6 +116,8 @@ describe ResourceImportFile do
115
116
  manifestation_104.original_title.should eq 'test10'
116
117
  manifestation_104.creators.collect(&:full_name).should eq ['test3']
117
118
  manifestation_104.publishers.collect(&:full_name).should eq ['test4']
119
+ manifestation_105 = Manifestation.find_by(manifestation_identifier: '105')
120
+ manifestation_105.serial.should be_truthy
118
121
 
119
122
  ResourceImportResult.where(manifestation_id: manifestation_101.id).order(:id).last.error_message.should eq "line 22: #{I18n.t('import.manifestation_found')}"
120
123
  ResourceImportResult.where(item_id: item_10101.id).order(:id).last.error_message.should eq "line 9: #{I18n.t('import.item_found')}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_biblio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-29 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: enju_library
@@ -114,126 +114,126 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.0.rc.1
117
+ version: 1.3.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.0.rc.1
124
+ version: 1.3.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: enju_manifestation_viewer
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.3.0.rc.1
131
+ version: 0.3.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.3.0.rc.1
138
+ version: 0.3.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: enju_subject
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.0.rc.1
145
+ version: 0.3.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.3.0.rc.1
152
+ version: 0.3.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: enju_inventory
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.3.0.beta.1
159
+ version: 0.3.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.3.0.beta.1
166
+ version: 0.3.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: enju_bookmark
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.3.0.beta.1
173
+ version: 0.3.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.3.0.beta.1
180
+ version: 0.3.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: enju_event
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 0.3.0.rc.1
187
+ version: 0.3.1
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 0.3.0.rc.1
194
+ version: 0.3.1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: enju_circulation
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 0.3.0.rc.1
201
+ version: 0.3.0
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 0.3.0.rc.1
208
+ version: 0.3.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: enju_ndl
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 0.3.0.rc.1
215
+ version: 0.3.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 0.3.0.rc.1
222
+ version: 0.3.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: enju_oai
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 0.3.0.beta.1
229
+ version: 0.3.0
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 0.3.0.beta.1
236
+ version: 0.3.0
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: sqlite3
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -378,16 +378,16 @@ dependencies:
378
378
  name: resque
379
379
  requirement: !ruby/object:Gem::Requirement
380
380
  requirements:
381
- - - "~>"
381
+ - - ">="
382
382
  - !ruby/object:Gem::Version
383
- version: '1.27'
383
+ version: '0'
384
384
  type: :development
385
385
  prerelease: false
386
386
  version_requirements: !ruby/object:Gem::Requirement
387
387
  requirements:
388
- - - "~>"
388
+ - - ">="
389
389
  - !ruby/object:Gem::Version
390
- version: '1.27'
390
+ version: '0'
391
391
  - !ruby/object:Gem::Dependency
392
392
  name: coveralls
393
393
  requirement: !ruby/object:Gem::Requirement