enju_inventory 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +11 -0
  3. data/app/controllers/inventory_files_controller.rb +10 -1
  4. data/app/models/inventory.rb +38 -11
  5. data/app/models/inventory_file.rb +34 -5
  6. data/app/views/inventory_files/_form.html.erb +23 -0
  7. data/app/views/inventory_files/_observe_field.html.erb +7 -0
  8. data/app/views/inventory_files/_results.html.erb +36 -0
  9. data/app/views/inventory_files/edit.html.erb +3 -33
  10. data/app/views/inventory_files/index.html.erb +2 -4
  11. data/app/views/inventory_files/new.html.erb +3 -14
  12. data/app/views/inventory_files/show.html.erb +44 -35
  13. data/config/locales/translation_en.yml +5 -1
  14. data/config/locales/translation_ja.yml +5 -1
  15. data/db/migrate/20191224083828_add_item_identifier_to_inventory.rb +6 -0
  16. data/db/migrate/20191224091957_add_current_shelf_name_to_inventory.rb +6 -0
  17. data/db/migrate/20191230082846_add_shelf_to_inventory_file.rb +5 -0
  18. data/lib/enju_inventory/version.rb +1 -1
  19. data/lib/generators/enju_inventory/setup/USAGE +8 -0
  20. data/lib/generators/enju_inventory/setup/setup_generator.rb +13 -0
  21. data/spec/controllers/inventories_controller_spec.rb +4 -4
  22. data/spec/controllers/inventory_files_controller_spec.rb +5 -6
  23. data/spec/controllers/items_controller_spec.rb +1 -1
  24. data/spec/dummy/app/models/application_record.rb +3 -0
  25. data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
  26. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
  27. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +8 -0
  28. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
  29. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
  30. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
  31. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
  32. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  33. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  34. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  35. data/spec/dummy/db/schema.rb +31 -1
  36. data/spec/fixtures/carrier_types.yml +54 -0
  37. data/spec/fixtures/circulation_statuses.yml +119 -0
  38. data/spec/fixtures/content_types.yml +98 -0
  39. data/spec/fixtures/inventories.yml +8 -6
  40. data/spec/fixtures/inventory_files.yml +4 -0
  41. data/spec/fixtures/items.yml +316 -0
  42. data/spec/fixtures/manifestations.yml +1891 -0
  43. data/spec/fixtures/shelves.yml +46 -0
  44. data/spec/fixtures/users.yml +1 -1
  45. data/spec/models/inventory_file_spec.rb +7 -2
  46. data/spec/models/inventory_spec.rb +8 -6
  47. metadata +291 -218
  48. data/README.rdoc +0 -10
@@ -0,0 +1,98 @@
1
+ ---
2
+ content_type_00001:
3
+ id: 1
4
+ name: text
5
+ display_name: "en: text\r\n\
6
+ ja: 文字"
7
+ note:
8
+ position: 1
9
+ content_type_00002:
10
+ id: 2
11
+ name: performed_music
12
+ display_name: "en: Performed music\r\n\
13
+ ja: 音楽"
14
+ note: 曲の演奏など
15
+ position: 2
16
+ content_type_00003:
17
+ id: 3
18
+ name: two_dimensional_moving_image
19
+ display_name: "en: Two-dimensional moving image\r\n\
20
+ ja: 動画"
21
+ note:
22
+ position: 3
23
+ content_type_00004:
24
+ id: 4
25
+ name: tactile_text
26
+ display_name: "en: Tactile text\r\n\
27
+ ja: 点字など"
28
+ note: 触ることのできる文字
29
+ position: 4
30
+ content_type_00005:
31
+ id: 5
32
+ name: still_image
33
+ display_name: "en: Still image\r\n\
34
+ ja: 画像"
35
+ note: 静止画像
36
+ position: 5
37
+ content_type_00006:
38
+ id: 6
39
+ name: cartographic_image
40
+ display_name: "en: Cartographic image\r\n\
41
+ ja: 地図"
42
+ note:
43
+ position: 6
44
+ content_type_00007:
45
+ id: 7
46
+ name: spoken_word
47
+ display_name: "en: Spoken word\r\n\
48
+ ja: 音声"
49
+ note: 読み上げ音声など
50
+ position: 7
51
+ content_type_00008:
52
+ id: 8
53
+ name: sounds
54
+ display_name: "en: Sounds\r\n\
55
+ ja: 音"
56
+ note: 波音など
57
+ position: 8
58
+ content_type_00009:
59
+ id: 9
60
+ name: notated_music
61
+ display_name: "en: Notated music\r\n\
62
+ ja: 楽譜"
63
+ note:
64
+ position: 9
65
+ content_type_00010:
66
+ id: 10
67
+ name: three_dimensional_moving_image
68
+ display_name: "en: Three-dimensional moving image\r\n\
69
+ ja: 3D動画"
70
+ note:
71
+ position: 10
72
+ content_type_00011:
73
+ id: 11
74
+ name: other
75
+ display_name: "en: Other\r\n\
76
+ ja: その他"
77
+ note: LCMARCに由来
78
+ position: 11
79
+ content_type_00012:
80
+ id: 12
81
+ name: unspecified
82
+ display_name: "en: Unspecified\r\n\
83
+ ja: 不明"
84
+ note: LCMARCに由来
85
+ position: 12
86
+
87
+ # == Schema Information
88
+ #
89
+ # Table name: content_types
90
+ #
91
+ # id :integer not null, primary key
92
+ # name :string not null
93
+ # display_name :text
94
+ # note :text
95
+ # position :integer
96
+ # created_at :datetime
97
+ # updated_at :datetime
98
+ #
@@ -16,10 +16,12 @@ inventory_00002:
16
16
  #
17
17
  # Table name: inventories
18
18
  #
19
- # id :integer not null, primary key
20
- # item_id :integer
21
- # inventory_file_id :integer
22
- # note :text
23
- # created_at :datetime
24
- # updated_at :datetime
19
+ # id :integer not null, primary key
20
+ # item_id :integer
21
+ # inventory_file_id :integer
22
+ # note :text
23
+ # created_at :datetime
24
+ # updated_at :datetime
25
+ # item_identifier :string
26
+ # current_shelf_name :string
25
27
  #
@@ -6,18 +6,21 @@ inventory_file_00001:
6
6
  inventory_file_size: 1
7
7
  user_id: 1
8
8
  inventory_content_type: text/csv
9
+ shelf_id: 2
9
10
  inventory_file_00002:
10
11
  id: 2
11
12
  inventory_file_name: MyString
12
13
  inventory_file_size: 1
13
14
  user_id: 1
14
15
  inventory_content_type: text/csv
16
+ shelf_id: 2
15
17
  inventory_file_00003:
16
18
  id: 3
17
19
  inventory_file_name: MyString
18
20
  inventory_file_size: 1
19
21
  user_id: 1
20
22
  inventory_content_type: text/csv
23
+ shelf_id: 3
21
24
 
22
25
  # == Schema Information
23
26
  #
@@ -36,4 +39,5 @@ inventory_file_00003:
36
39
  # inventory_file_size :integer
37
40
  # inventory_updated_at :datetime
38
41
  # inventory_fingerprint :string
42
+ # shelf_id :integer
39
43
  #
@@ -0,0 +1,316 @@
1
+ ---
2
+ item_00001:
3
+ updated_at: 2007-08-24 23:46:00.484813 +09:00
4
+ item_identifier: '00001'
5
+ circulation_status_id: 2
6
+ checkout_type_id: 1
7
+ shelf_id: 1
8
+ call_number:
9
+ manifestation_id: 1
10
+ id: 1
11
+ include_supplements: false
12
+ created_at: 2007-08-24 23:46:00.484813 +09:00
13
+ item_00002:
14
+ updated_at: 2007-08-24 23:46:01.641413 +09:00
15
+ item_identifier: '00002'
16
+ circulation_status_id: 2
17
+ checkout_type_id: 1
18
+ shelf_id: 1
19
+ call_number:
20
+ manifestation_id: 2
21
+ id: 2
22
+ include_supplements: false
23
+ created_at: 2007-08-24 23:46:01.641413 +09:00
24
+ item_00003:
25
+ updated_at: 2007-08-24 23:46:02.502569 +09:00
26
+ item_identifier: '00003'
27
+ circulation_status_id: 2
28
+ checkout_type_id: 2
29
+ shelf_id: 1
30
+ call_number:
31
+ manifestation_id: 3
32
+ id: 3
33
+ include_supplements: false
34
+ created_at: 2007-08-24 23:46:02.502569 +09:00
35
+ item_00004:
36
+ updated_at: 2007-08-24 23:46:03.520781 +09:00
37
+ item_identifier: '00004'
38
+ circulation_status_id: 2
39
+ checkout_type_id: 1
40
+ shelf_id: 1
41
+ call_number:
42
+ manifestation_id: 1
43
+ id: 4
44
+ include_supplements: true
45
+ created_at: 2007-08-24 23:46:03.520781 +09:00
46
+ item_00005:
47
+ updated_at: 2007-08-24 23:46:04.538073 +09:00
48
+ item_identifier: '00005'
49
+ circulation_status_id: 2
50
+ checkout_type_id: 2
51
+ shelf_id: 1
52
+ call_number:
53
+ manifestation_id: 2
54
+ id: 5
55
+ include_supplements: false
56
+ created_at: 2007-08-24 23:46:04.538073 +09:00
57
+ item_00006:
58
+ updated_at: 2007-08-24 23:46:05.555353 +09:00
59
+ item_identifier: '00006'
60
+ circulation_status_id: 2
61
+ checkout_type_id: 2
62
+ shelf_id: 1
63
+ call_number:
64
+ manifestation_id: 3
65
+ id: 6
66
+ include_supplements: true
67
+ created_at: 2007-08-24 23:46:05.555353 +09:00
68
+ item_00007:
69
+ updated_at: 2007-08-24 23:46:06.572631 +09:00
70
+ item_identifier: '00007'
71
+ circulation_status_id: 2
72
+ checkout_type_id: 1
73
+ shelf_id: 1
74
+ call_number:
75
+ manifestation_id: 1
76
+ id: 7
77
+ include_supplements: false
78
+ created_at: 2007-08-24 23:46:06.572631 +09:00
79
+ item_00008:
80
+ updated_at: 2007-08-24 23:46:07.589909 +09:00
81
+ item_identifier: '00008'
82
+ circulation_status_id: 2
83
+ checkout_type_id: 2
84
+ shelf_id: 1
85
+ call_number:
86
+ manifestation_id: 2
87
+ id: 8
88
+ include_supplements: true
89
+ created_at: 2007-08-24 23:46:07.589909 +09:00
90
+ item_00009:
91
+ updated_at: 2007-08-24 23:46:08.607081 +09:00
92
+ item_identifier: '00009'
93
+ circulation_status_id: 2
94
+ checkout_type_id: 1
95
+ shelf_id: 4
96
+ call_number:
97
+ manifestation_id: 3
98
+ id: 9
99
+ include_supplements: false
100
+ created_at: 2007-08-24 23:46:08.607081 +09:00
101
+ item_00010:
102
+ updated_at: 2007-08-24 23:46:09.624281 +09:00
103
+ item_identifier: '00010'
104
+ circulation_status_id: 2
105
+ checkout_type_id: 2
106
+ shelf_id: 1
107
+ call_number:
108
+ manifestation_id: 1
109
+ id: 10
110
+ include_supplements: false
111
+ created_at: 2007-08-24 23:46:09.624281 +09:00
112
+ item_00011:
113
+ updated_at: 2007-08-24 23:46:10.484813 +09:00
114
+ item_identifier: '00011'
115
+ circulation_status_id: 2
116
+ checkout_type_id: 1
117
+ shelf_id: 1
118
+ call_number:
119
+ manifestation_id: 1
120
+ id: 11
121
+ include_supplements: false
122
+ created_at: 2007-08-24 23:46:10.484813 +09:00
123
+ item_00012:
124
+ updated_at: 2007-08-24 23:46:11.484813 +09:00
125
+ item_identifier: '00012'
126
+ circulation_status_id: 3
127
+ checkout_type_id: 2
128
+ shelf_id: 1
129
+ call_number:
130
+ manifestation_id: 2
131
+ id: 12
132
+ include_supplements: false
133
+ created_at: 2007-08-24 23:46:11.484813 +09:00
134
+ item_00013:
135
+ updated_at: 2007-08-24 23:46:12.484813 +09:00
136
+ item_identifier: '00013'
137
+ circulation_status_id: 10
138
+ checkout_type_id: 1
139
+ shelf_id: 1
140
+ call_number:
141
+ manifestation_id: 2
142
+ id: 13
143
+ include_supplements: false
144
+ created_at: 2007-08-24 23:46:12.484813 +09:00
145
+ item_00014:
146
+ updated_at: 2007-08-24 23:46:13.484813 +09:00
147
+ item_identifier: '00014'
148
+ circulation_status_id: 10
149
+ checkout_type_id: 2
150
+ shelf_id: 1
151
+ call_number:
152
+ manifestation_id: 2
153
+ id: 14
154
+ include_supplements: false
155
+ created_at: 2007-08-24 23:46:13.484813 +09:00
156
+ item_00015:
157
+ updated_at: 2007-08-24 23:46:14.484813 +09:00
158
+ item_identifier: '00015'
159
+ circulation_status_id: 10
160
+ checkout_type_id: 3
161
+ shelf_id: 1
162
+ call_number:
163
+ manifestation_id: 2
164
+ id: 15
165
+ include_supplements: false
166
+ created_at: 2007-08-24 23:46:14.484813 +09:00
167
+ item_00016:
168
+ updated_at: 2007-08-24 23:46:15.484813 +09:00
169
+ item_identifier: '00016'
170
+ circulation_status_id: 10
171
+ checkout_type_id: 2
172
+ shelf_id: 1
173
+ call_number:
174
+ manifestation_id: 3
175
+ id: 16
176
+ include_supplements: true
177
+ created_at: 2007-08-24 23:46:15.484813 +09:00
178
+ item_00017:
179
+ updated_at: 2007-08-24 23:46:16.484813 +09:00
180
+ item_identifier: '00017'
181
+ circulation_status_id: 10
182
+ checkout_type_id: 3
183
+ shelf_id: 1
184
+ call_number:
185
+ manifestation_id: 3
186
+ id: 17
187
+ include_supplements: false
188
+ created_at: 2007-08-24 23:46:16.484813 +09:00
189
+ item_00018:
190
+ updated_at: 2007-08-24 23:46:17.484813 +09:00
191
+ item_identifier: '00018'
192
+ circulation_status_id: 10
193
+ checkout_type_id: 3
194
+ shelf_id: 1
195
+ call_number:
196
+ manifestation_id: 1
197
+ id: 18
198
+ include_supplements: false
199
+ created_at: 2007-08-24 23:46:17.484813 +09:00
200
+ item_00019:
201
+ updated_at: 2007-08-24 23:46:18.484813 +09:00
202
+ item_identifier: '00019'
203
+ circulation_status_id: 2
204
+ checkout_type_id: 3
205
+ shelf_id: 1
206
+ call_number:
207
+ manifestation_id: 1
208
+ id: 19
209
+ include_supplements: false
210
+ created_at: 2007-08-24 23:46:18.484813 +09:00
211
+ item_00020:
212
+ updated_at: 2007-08-24 23:46:19.484813 +09:00
213
+ item_identifier: '00020'
214
+ circulation_status_id: 13
215
+ checkout_type_id: 3
216
+ shelf_id: 1
217
+ call_number:
218
+ manifestation_id: 1
219
+ id: 20
220
+ include_supplements: false
221
+ created_at: 2007-08-24 23:46:19.484813 +09:00
222
+ item_00021:
223
+ updated_at: 2007-08-24 23:46:20.484813 +09:00
224
+ item_identifier: '00021'
225
+ circulation_status_id: 2
226
+ checkout_type_id: 3
227
+ shelf_id: 1
228
+ call_number:
229
+ manifestation_id: 11
230
+ id: 21
231
+ include_supplements: false
232
+ created_at: 2007-08-24 23:46:20.484813 +09:00
233
+ item_00022:
234
+ updated_at: 2007-08-24 23:46:20.484813 +09:00
235
+ item_identifier: '00022'
236
+ circulation_status_id: 2
237
+ checkout_type_id: 3
238
+ shelf_id: 1
239
+ call_number:
240
+ manifestation_id: 11
241
+ id: 22
242
+ include_supplements: false
243
+ created_at: 2007-08-24 23:46:20.484813 +09:00
244
+ item_00023:
245
+ updated_at: 2007-08-24 23:46:20.484813 +09:00
246
+ item_identifier: '00023'
247
+ circulation_status_id: 2
248
+ checkout_type_id: 3
249
+ shelf_id: 2
250
+ call_number:
251
+ manifestation_id: 11
252
+ id: 23
253
+ include_supplements: false
254
+ created_at: 2007-08-24 23:46:20.484813 +09:00
255
+ item_00024:
256
+ updated_at: 2007-08-24 23:46:20.484813 +09:00
257
+ item_identifier: '00024'
258
+ circulation_status_id: 8
259
+ checkout_type_id: 3
260
+ shelf_id: 2
261
+ call_number:
262
+ id: 24
263
+ include_supplements: false
264
+ created_at: 2007-08-24 23:46:20.484813 +09:00
265
+ manifestation_id: 9
266
+ item_00025:
267
+ updated_at: 2007-08-24 23:46:20.484813 +09:00
268
+ item_identifier: '00025'
269
+ circulation_status_id: 8
270
+ checkout_type_id: 3
271
+ shelf_id: 2
272
+ call_number:
273
+ id: 25
274
+ include_supplements: false
275
+ created_at: 2007-08-24 23:46:20.484813 +09:00
276
+ manifestation_id: 10
277
+ item_00026:
278
+ updated_at: 2007-08-24 23:46:20.484813 +09:00
279
+ item_identifier: '00026'
280
+ circulation_status_id: 16
281
+ checkout_type_id: 3
282
+ shelf_id: 2
283
+ call_number:
284
+ id: 26
285
+ include_supplements: false
286
+ created_at: 2007-08-24 23:46:20.484813 +09:00
287
+ manifestation_id: 10
288
+
289
+ # == Schema Information
290
+ #
291
+ # Table name: items
292
+ #
293
+ # id :integer not null, primary key
294
+ # call_number :string(255)
295
+ # item_identifier :string(255)
296
+ # created_at :datetime not null
297
+ # updated_at :datetime not null
298
+ # deleted_at :datetime
299
+ # shelf_id :integer default(1), not null
300
+ # include_supplements :boolean default(FALSE), not null
301
+ # note :text
302
+ # url :string(255)
303
+ # price :integer
304
+ # lock_version :integer default(0), not null
305
+ # required_role_id :integer default(1), not null
306
+ # required_score :integer default(0), not null
307
+ # acquired_at :datetime
308
+ # bookstore_id :integer
309
+ # budget_type_id :integer
310
+ # circulation_status_id :integer default(5), not null
311
+ # checkout_type_id :integer default(1), not null
312
+ # binding_item_identifier :string(255)
313
+ # binding_call_number :string(255)
314
+ # binded_at :datetime
315
+ # manifestation_id :integer
316
+ #