enju_biblio 0.4.0.beta.2 → 0.4.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/items_controller.rb +5 -1
- data/app/controllers/manifestations_controller.rb +12 -6
- data/app/mailers/agent_import_mailer.rb +2 -2
- data/app/mailers/resource_export_mailer.rb +2 -2
- data/app/mailers/resource_import_mailer.rb +2 -2
- data/app/models/agent.rb +3 -4
- data/app/models/agent_import_file.rb +1 -8
- data/app/models/custom_property.rb +17 -0
- data/app/models/import_request.rb +0 -9
- data/app/models/isbn_record.rb +1 -1
- data/app/models/issn_record.rb +1 -1
- data/app/models/item.rb +49 -2
- data/app/models/manifestation.rb +109 -247
- data/app/models/resource_export_file.rb +3 -16
- data/app/models/resource_export_file_state_machine.rb +1 -1
- data/app/models/resource_import_file.rb +1 -9
- data/app/views/items/_custom_property_fields.html.erb +7 -0
- data/app/views/items/_form.html.erb +18 -6
- data/app/views/items/show.html.erb +8 -1
- data/app/views/layouts/items.html.erb +1 -1
- data/app/views/layouts/manifestations.html.erb +1 -1
- data/app/views/manifestations/_custom_property_fields.html.erb +7 -0
- data/app/views/manifestations/_form.html.erb +10 -0
- data/app/views/manifestations/_manifestation.txt.erb +1 -1
- data/app/views/manifestations/_paginate_id_link.html.erb +1 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +9 -1
- data/app/views/manifestations/_show_detail_user.html.erb +1 -1
- data/app/views/manifestations/index.txt.ruby +7 -0
- data/app/views/manifestations/show.txt.ruby +5 -0
- data/app/views/resource_import_files/_results.html.erb +6 -0
- data/app/views/resource_import_results/index.html.erb +0 -11
- data/app/views/series_statements/_form.html.erb +6 -8
- data/app/views/series_statements/show.html.erb +12 -0
- data/config/locales/translation_en.yml +12 -1
- data/config/locales/translation_ja.yml +14 -3
- data/db/migrate/001_create_agents.rb +0 -1
- data/db/migrate/005_create_manifestations.rb +0 -1
- data/db/migrate/006_create_items.rb +0 -1
- data/db/migrate/20191219122214_create_custom_properties.rb +12 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/setup_generator.rb +2 -0
- data/spec/controllers/items_controller_spec.rb +25 -0
- data/spec/controllers/manifestations_controller_spec.rb +52 -0
- data/spec/dummy/app/controllers/application_controller.rb +0 -1
- data/spec/dummy/app/models/user.rb +0 -2
- data/spec/dummy/config/environments/development.rb +11 -24
- data/spec/dummy/config/environments/production.rb +16 -28
- data/spec/dummy/config/environments/test.rb +6 -6
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/db/migrate/059_create_libraries.rb +1 -2
- data/spec/dummy/db/migrate/069_create_shelves.rb +1 -2
- data/spec/dummy/db/migrate/077_create_user_groups.rb +1 -2
- data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -1
- data/spec/dummy/db/migrate/120_create_baskets.rb +1 -1
- data/spec/dummy/db/migrate/124_create_bookstores.rb +1 -2
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
- data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +1 -2
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -1
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +1 -1
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -6
- data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -6
- data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
- data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
- data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
- data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
- data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20191216131755_add_email_to_library_group.rb +6 -0
- data/spec/dummy/db/schema.rb +96 -91
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/public/500.html +1 -0
- data/spec/factories/custom_property.rb +18 -0
- data/spec/factories/series_statement.rb +4 -3
- data/spec/fixtures/agents.yml +0 -1
- data/spec/fixtures/bookstores.yml +0 -8
- data/spec/fixtures/budget_types.yml +10 -9
- data/spec/fixtures/events.yml +0 -9
- data/spec/fixtures/items.yml +10 -11
- data/spec/fixtures/library_groups.yml +6 -11
- data/spec/fixtures/manifestations.yml +0 -1
- data/spec/models/agent_spec.rb +0 -1
- data/spec/models/custom_property_spec.rb +18 -0
- data/spec/models/item_spec.rb +0 -1
- data/spec/models/manifestation_spec.rb +32 -8
- data/spec/rails_helper.rb +3 -3
- data/spec/system/custom_properties_spec.rb +84 -0
- data/spec/system/items_spec.rb +60 -0
- data/spec/system/series_statements_spec.rb +16 -0
- data/spec/views/manifestations/index.json.jbuilder_spec.rb +18 -0
- data/spec/views/manifestations/{index.txt.erb_spec.rb → index.txt.ruby_spec.rb} +1 -1
- data/spec/views/manifestations/{show.txt.erb_spec.rb → show.txt.ruby_spec.rb} +1 -1
- metadata +56 -58
- data/app/views/manifestations/index.txt.erb +0 -1
- data/app/views/manifestations/show.txt.erb +0 -1
- data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +0 -20
- data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +0 -15
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/public/500.html
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :custom_property do
|
3
|
+
sequence(:label){|n| "custom property #{n}"}
|
4
|
+
sequence(:value){|n| "カスタム項目 #{n}"}
|
5
|
+
end
|
6
|
+
|
7
|
+
factory :manifestation_custom_property, class: CustomProperty do
|
8
|
+
association :resource, factory: :manifestation
|
9
|
+
sequence(:label){|n| "custom property #{n}"}
|
10
|
+
sequence(:value){|n| "カスタム項目 #{n}"}
|
11
|
+
end
|
12
|
+
|
13
|
+
factory :item_custom_property, class: CustomProperty do
|
14
|
+
association :resource, factory: :item
|
15
|
+
sequence(:label){|n| "custom property #{n}"}
|
16
|
+
sequence(:value){|n| "カスタム項目 #{n}"}
|
17
|
+
end
|
18
|
+
end
|
@@ -2,9 +2,10 @@ FactoryBot.define do
|
|
2
2
|
factory :series_statement do |f|
|
3
3
|
f.sequence(:original_title){|n| "series_statement_#{n}"}
|
4
4
|
end
|
5
|
-
factory :series_statement_serial, class: SeriesStatement do
|
6
|
-
|
5
|
+
factory :series_statement_serial, class: SeriesStatement do
|
6
|
+
sequence(:original_title){|n| "series_statement_serial_#{n}" }
|
7
|
+
sequence(:creator_string){|n| "シリーズの著者 #{n}" }
|
7
8
|
#f.root_manifestation_id{FactoryBot.create(:manifestation_serial).id}
|
8
|
-
|
9
|
+
series_master{true}
|
9
10
|
end
|
10
11
|
end
|
data/spec/fixtures/agents.yml
CHANGED
@@ -3,7 +3,6 @@ bookstore_00001:
|
|
3
3
|
name: unknown
|
4
4
|
fax_number:
|
5
5
|
updated_at: 2008-02-10 11:14:57.605329 +09:00
|
6
|
-
deleted_at:
|
7
6
|
telephone_number:
|
8
7
|
id: 1
|
9
8
|
note: ""
|
@@ -16,7 +15,6 @@ bookstore_00002:
|
|
16
15
|
|
17
16
|
fax_number: ""
|
18
17
|
updated_at: 2008-02-10 12:15:14.840711 +09:00
|
19
|
-
deleted_at:
|
20
18
|
telephone_number: ""
|
21
19
|
id: 2
|
22
20
|
note: ""
|
@@ -29,7 +27,6 @@ bookstore_00003:
|
|
29
27
|
|
30
28
|
fax_number: ""
|
31
29
|
updated_at: 2008-02-10 12:15:33.555463 +09:00
|
32
|
-
deleted_at:
|
33
30
|
telephone_number: ""
|
34
31
|
id: 3
|
35
32
|
note: ""
|
@@ -42,7 +39,6 @@ bookstore_00004:
|
|
42
39
|
|
43
40
|
fax_number: ""
|
44
41
|
updated_at: 2008-02-10 12:16:07.726445 +09:00
|
45
|
-
deleted_at:
|
46
42
|
telephone_number: ""
|
47
43
|
id: 4
|
48
44
|
note: ""
|
@@ -55,7 +51,6 @@ bookstore_00005:
|
|
55
51
|
|
56
52
|
fax_number: ""
|
57
53
|
updated_at: 2008-02-10 12:16:17.990285 +09:00
|
58
|
-
deleted_at:
|
59
54
|
telephone_number: ""
|
60
55
|
id: 5
|
61
56
|
note: ""
|
@@ -68,7 +63,6 @@ bookstore_00006:
|
|
68
63
|
|
69
64
|
fax_number: ""
|
70
65
|
updated_at: 2008-02-10 12:16:25.906073 +09:00
|
71
|
-
deleted_at:
|
72
66
|
telephone_number: ""
|
73
67
|
id: 6
|
74
68
|
note: ""
|
@@ -79,7 +73,6 @@ bookstore_00007:
|
|
79
73
|
name: Example store
|
80
74
|
fax_number: ""
|
81
75
|
updated_at: 2008-02-10 12:16:25.906073 +09:00
|
82
|
-
deleted_at:
|
83
76
|
telephone_number: ""
|
84
77
|
id: 7
|
85
78
|
note: ""
|
@@ -100,7 +93,6 @@ bookstore_00007:
|
|
100
93
|
# fax_number :string(255)
|
101
94
|
# url :string(255)
|
102
95
|
# position :integer
|
103
|
-
# deleted_at :datetime
|
104
96
|
# created_at :datetime
|
105
97
|
# updated_at :datetime
|
106
98
|
#
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
public_fund:
|
4
4
|
name: Public fund
|
5
|
-
|
5
|
+
display_name_translations: {"en": "Public fund", "ja": "公的資金"}
|
6
6
|
note:
|
7
7
|
position: 1
|
8
8
|
id: 1
|
9
9
|
|
10
10
|
donation:
|
11
11
|
name: Donation
|
12
|
-
|
12
|
+
display_name_translations: {"en": "Donation", "ja": "寄贈"}
|
13
13
|
note:
|
14
14
|
position: 2
|
15
15
|
id: 2
|
@@ -18,12 +18,13 @@ donation:
|
|
18
18
|
#
|
19
19
|
# Table name: budget_types
|
20
20
|
#
|
21
|
-
# id
|
22
|
-
# name
|
23
|
-
# display_name
|
24
|
-
# note
|
25
|
-
# position
|
26
|
-
# created_at
|
27
|
-
# updated_at
|
21
|
+
# id :bigint not null, primary key
|
22
|
+
# name :string
|
23
|
+
# display_name :text
|
24
|
+
# note :text
|
25
|
+
# position :integer
|
26
|
+
# created_at :datetime not null
|
27
|
+
# updated_at :datetime not null
|
28
|
+
# display_name_translations :jsonb not null
|
28
29
|
#
|
29
30
|
|
data/spec/fixtures/events.yml
CHANGED
@@ -5,7 +5,6 @@ event_00001:
|
|
5
5
|
end_at: 2008-01-14 02:54:00 +09:00
|
6
6
|
name: 仕事始め
|
7
7
|
display_name: 仕事始め
|
8
|
-
deleted_at:
|
9
8
|
start_at: 2008-01-13 02:54:00 +09:00
|
10
9
|
id: 1
|
11
10
|
note: なんとかかんとか
|
@@ -17,7 +16,6 @@ event_00002:
|
|
17
16
|
end_at: 2008-01-14 02:54:00 +09:00
|
18
17
|
name: テスト
|
19
18
|
display_name: テスト
|
20
|
-
deleted_at:
|
21
19
|
start_at: 2008-01-13 02:54:00 +09:00
|
22
20
|
id: 2
|
23
21
|
note: テスト用のイベントです。
|
@@ -29,7 +27,6 @@ event_00003:
|
|
29
27
|
end_at: 2008-02-05 00:00:00 +09:00
|
30
28
|
name: ミーティング
|
31
29
|
display_name: ミーティング
|
32
|
-
deleted_at:
|
33
30
|
start_at: 2008-01-13 00:00:00 +09:00
|
34
31
|
id: 3
|
35
32
|
note: ""
|
@@ -41,7 +38,6 @@ event_00004:
|
|
41
38
|
end_at: 2008-02-06 00:00:00 +09:00
|
42
39
|
name: テスト
|
43
40
|
display_name: テスト
|
44
|
-
deleted_at:
|
45
41
|
start_at: 2008-02-05 00:00:00 +09:00
|
46
42
|
id: 4
|
47
43
|
note: なんとかかんとか
|
@@ -53,7 +49,6 @@ event_00005:
|
|
53
49
|
end_at: 2008-02-08 00:00:00 +09:00
|
54
50
|
name: test
|
55
51
|
display_name: test
|
56
|
-
deleted_at:
|
57
52
|
start_at: 2008-02-05 00:00:00 +09:00
|
58
53
|
id: 5
|
59
54
|
note: ""
|
@@ -65,7 +60,6 @@ event_00006:
|
|
65
60
|
end_at: 2008-02-08 00:00:00 +09:00
|
66
61
|
name: なんとかかんとか
|
67
62
|
display_name: なんとかかんとか
|
68
|
-
deleted_at:
|
69
63
|
start_at: 2008-02-05 00:00:00 +09:00
|
70
64
|
id: 6
|
71
65
|
note: ""
|
@@ -77,7 +71,6 @@ event_00007:
|
|
77
71
|
end_at: 2008-02-08 00:00:00 +09:00
|
78
72
|
name: test
|
79
73
|
display_name: test
|
80
|
-
deleted_at:
|
81
74
|
start_at: 2008-02-05 00:00:00 +09:00
|
82
75
|
id: 7
|
83
76
|
note: test
|
@@ -89,7 +82,6 @@ event_00008:
|
|
89
82
|
end_at: 2008-02-05 15:00:00 +09:00
|
90
83
|
name: test
|
91
84
|
display_name: test
|
92
|
-
deleted_at:
|
93
85
|
start_at: 2008-02-05 15:00:00 +09:00
|
94
86
|
id: 8
|
95
87
|
note: test
|
@@ -108,7 +100,6 @@ event_00008:
|
|
108
100
|
# start_at :datetime
|
109
101
|
# end_at :datetime
|
110
102
|
# all_day :boolean default(FALSE), not null
|
111
|
-
# deleted_at :datetime
|
112
103
|
# created_at :datetime
|
113
104
|
# updated_at :datetime
|
114
105
|
# display_name :text
|
data/spec/fixtures/items.yml
CHANGED
@@ -231,7 +231,7 @@ item_00021:
|
|
231
231
|
include_supplements: false
|
232
232
|
created_at: 2007-08-24 23:46:20.484813 +09:00
|
233
233
|
item_00022:
|
234
|
-
updated_at: 2007-08-24 23:46:
|
234
|
+
updated_at: 2007-08-24 23:46:21.484813 +09:00
|
235
235
|
item_identifier: '00022'
|
236
236
|
circulation_status_id: 2
|
237
237
|
checkout_type_id: 3
|
@@ -240,9 +240,9 @@ item_00022:
|
|
240
240
|
manifestation_id: 11
|
241
241
|
id: 22
|
242
242
|
include_supplements: false
|
243
|
-
created_at: 2007-08-24 23:46:
|
243
|
+
created_at: 2007-08-24 23:46:21.484813 +09:00
|
244
244
|
item_00023:
|
245
|
-
updated_at: 2007-08-24 23:46:
|
245
|
+
updated_at: 2007-08-24 23:46:22.484813 +09:00
|
246
246
|
item_identifier: '00023'
|
247
247
|
circulation_status_id: 16
|
248
248
|
checkout_type_id: 3
|
@@ -251,9 +251,9 @@ item_00023:
|
|
251
251
|
manifestation_id: 11
|
252
252
|
id: 23
|
253
253
|
include_supplements: false
|
254
|
-
created_at: 2007-08-24 23:46:
|
254
|
+
created_at: 2007-08-24 23:46:22.484813 +09:00
|
255
255
|
item_00024:
|
256
|
-
updated_at: 2007-08-24 23:46:
|
256
|
+
updated_at: 2007-08-24 23:46:23.607081 +09:00
|
257
257
|
item_identifier: '00024'
|
258
258
|
circulation_status_id: 2
|
259
259
|
checkout_type_id: 1
|
@@ -262,10 +262,10 @@ item_00024:
|
|
262
262
|
manifestation_id: 102
|
263
263
|
id: 24
|
264
264
|
include_supplements: false
|
265
|
-
created_at: 2007-08-24 23:
|
266
|
-
acquired_at: 2015-08-25 23:
|
265
|
+
created_at: 2007-08-24 23:23:08.607081 +09:00
|
266
|
+
acquired_at: 2015-08-25 23:23:08.607081 +09:00
|
267
267
|
item_00025:
|
268
|
-
updated_at: 2007-08-24 23:46:
|
268
|
+
updated_at: 2007-08-24 23:46:24.607081 +09:00
|
269
269
|
item_identifier: '00025'
|
270
270
|
circulation_status_id: 2
|
271
271
|
checkout_type_id: 1
|
@@ -274,8 +274,8 @@ item_00025:
|
|
274
274
|
manifestation_id: 102
|
275
275
|
id: 25
|
276
276
|
include_supplements: false
|
277
|
-
created_at: 2007-08-24 23:46:
|
278
|
-
acquired_at: 2015-09-25 23:46:
|
277
|
+
created_at: 2007-08-24 23:46:24.607081 +09:00
|
278
|
+
acquired_at: 2015-09-25 23:46:24.607081 +09:00
|
279
279
|
|
280
280
|
# == Schema Information
|
281
281
|
#
|
@@ -286,7 +286,6 @@ item_00025:
|
|
286
286
|
# item_identifier :string
|
287
287
|
# created_at :datetime
|
288
288
|
# updated_at :datetime
|
289
|
-
# deleted_at :datetime
|
290
289
|
# shelf_id :integer default(1), not null
|
291
290
|
# include_supplements :boolean default(FALSE), not null
|
292
291
|
# note :text
|
@@ -15,25 +15,25 @@ one:
|
|
15
15
|
"ja":"[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム | [このシステムについて](/page/about) | [不具合を報告する](https://github.com/next-l/enju_leaf/issues) | [マニュアル](https://next-l.github.io/manual/1.3/)"}
|
16
16
|
admin_networks: "0.0.0.0/0\r\n\
|
17
17
|
::/0"
|
18
|
-
|
18
|
+
email: library@example.jp
|
19
19
|
pub_year_facet_range_interval: 10
|
20
20
|
|
21
21
|
# == Schema Information
|
22
22
|
#
|
23
23
|
# Table name: library_groups
|
24
24
|
#
|
25
|
-
# id :
|
25
|
+
# id :bigint not null, primary key
|
26
26
|
# name :string not null
|
27
|
-
# display_name :text
|
28
27
|
# short_name :string not null
|
29
28
|
# my_networks :text
|
30
29
|
# old_login_banner :text
|
31
30
|
# note :text
|
32
31
|
# country_id :integer
|
33
32
|
# position :integer
|
34
|
-
# created_at :datetime
|
35
|
-
# updated_at :datetime
|
33
|
+
# created_at :datetime not null
|
34
|
+
# updated_at :datetime not null
|
36
35
|
# admin_networks :text
|
36
|
+
# allow_bookmark_external_url :boolean default(FALSE), not null
|
37
37
|
# url :string default("http://localhost:3000/")
|
38
38
|
# settings :text
|
39
39
|
# html_snippet :text
|
@@ -42,14 +42,9 @@ one:
|
|
42
42
|
# family_name_first :boolean default(TRUE)
|
43
43
|
# screenshot_generator :string
|
44
44
|
# pub_year_facet_range_interval :integer default(10)
|
45
|
-
# user_id :integer
|
46
45
|
# csv_charset_conversion :boolean default(FALSE), not null
|
47
|
-
# header_logo_file_name :string
|
48
|
-
# header_logo_content_type :string
|
49
|
-
# header_logo_file_size :bigint
|
50
|
-
# header_logo_updated_at :datetime
|
51
|
-
# header_logo_meta :text
|
52
46
|
# display_name_translations :jsonb not null
|
53
47
|
# login_banner_translations :jsonb not null
|
54
48
|
# footer_banner_translations :jsonb not null
|
49
|
+
# email :string
|
55
50
|
#
|
@@ -1841,7 +1841,6 @@ manifestation_00217:
|
|
1841
1841
|
# date_copyrighted :datetime
|
1842
1842
|
# created_at :datetime
|
1843
1843
|
# updated_at :datetime
|
1844
|
-
# deleted_at :datetime
|
1845
1844
|
# access_address :string
|
1846
1845
|
# language_id :integer default(1), not null
|
1847
1846
|
# carrier_type_id :integer default(1), not null
|
data/spec/models/agent_spec.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe CustomProperty, type: :model do
|
4
|
+
pending "add some examples to (or delete) #{__FILE__}"
|
5
|
+
end
|
6
|
+
|
7
|
+
# == Schema Information
|
8
|
+
#
|
9
|
+
# Table name: custom_properties
|
10
|
+
#
|
11
|
+
# id :bigint not null, primary key
|
12
|
+
# resource_id :integer not null
|
13
|
+
# resource_type :string not null
|
14
|
+
# label :text not null
|
15
|
+
# value :text
|
16
|
+
# created_at :datetime not null
|
17
|
+
# updated_at :datetime not null
|
18
|
+
#
|
data/spec/models/item_spec.rb
CHANGED
@@ -227,8 +227,8 @@ describe Manifestation, solr: true do
|
|
227
227
|
csv["item_id"].compact.should_not be_empty
|
228
228
|
csv["item_created_at"].compact.should_not be_empty
|
229
229
|
csv["item_updated_at"].compact.should_not be_empty
|
230
|
-
csv["subject:unknown"].compact.should eq manifestations(:manifestation_00001).items.count
|
231
|
-
csv["classification:ndc9"].compact.should eq manifestations(:manifestation_00001).items.count
|
230
|
+
csv["subject:unknown"].compact.inject(0){|count, a| count += 1 if a == 'next-l'; count}.should eq manifestations(:manifestation_00001).items.count
|
231
|
+
csv["classification:ndc9"].compact.inject(0){|count, a| count += 1 if a == '400'; count}.should eq manifestations(:manifestation_00001).items.count
|
232
232
|
csv["extent"].compact.should_not be_empty
|
233
233
|
csv["dimensions"].compact.should_not be_empty
|
234
234
|
end
|
@@ -274,13 +274,13 @@ describe Manifestation, solr: true do
|
|
274
274
|
|
275
275
|
it "should respect the role of the user" do
|
276
276
|
FactoryBot.create(:item, bookstore_id: 1, price: 100, budget_type_id: 1)
|
277
|
-
lines = Manifestation.export
|
277
|
+
lines = Manifestation.export(role: 'Guest')
|
278
278
|
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
279
279
|
expect(csv["bookstore"].compact).to be_empty
|
280
280
|
expect(csv["item_price"].compact).to be_empty
|
281
281
|
expect(csv["budget_type"].compact).to be_empty
|
282
282
|
|
283
|
-
lines = Manifestation.export(
|
283
|
+
lines = Manifestation.export(role: 'Librarian')
|
284
284
|
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
285
285
|
expect(csv["bookstore"].compact).not_to be_empty
|
286
286
|
expect(csv["item_price"].compact).not_to be_empty
|
@@ -296,9 +296,34 @@ describe Manifestation, solr: true do
|
|
296
296
|
expect(csv["note"].compact).not_to be_empty
|
297
297
|
expect(csv["item_note"].compact).not_to be_empty
|
298
298
|
m = csv.find{|row| row["manifestation_id"].to_i == manifestation.id }
|
299
|
-
expect(m["description"]).to eq
|
300
|
-
expect(m["note"]).to eq
|
301
|
-
expect(m["item_note"]).to eq
|
299
|
+
expect(m["description"]).to eq "test\ntest"
|
300
|
+
expect(m["note"]).to eq "test\ntest"
|
301
|
+
expect(m["item_note"]).to eq "test\ntest"
|
302
|
+
end
|
303
|
+
|
304
|
+
it 'should export custom properties with Librarian role' do
|
305
|
+
item = FactoryBot.create(:item)
|
306
|
+
item.manifestation.custom_properties << FactoryBot.build(:custom_property, label: 'テスト項目1', value: 'テスト')
|
307
|
+
2.times do
|
308
|
+
item.custom_properties << FactoryBot.build(:custom_property, label: 'テスト項目2', value: 'test')
|
309
|
+
end
|
310
|
+
|
311
|
+
lines = Manifestation.export(role: 'Librarian')
|
312
|
+
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
313
|
+
m = csv.find{|row| row["manifestation_id"].to_i == item.manifestation_id }
|
314
|
+
expect(m['manifestation_custom_property_1']).to eq 'テスト項目1: テスト'
|
315
|
+
expect(m['item_custom_property_2']).to eq 'テスト項目2: test'
|
316
|
+
end
|
317
|
+
|
318
|
+
it 'should not export custom properties with User role' do
|
319
|
+
item = FactoryBot.create(:item)
|
320
|
+
item.manifestation.custom_properties << FactoryBot.build(:custom_property, label: 'テスト項目1', value: 'テスト')
|
321
|
+
item.custom_properties << FactoryBot.build(:custom_property, label: 'テスト項目2', value: 'test')
|
322
|
+
|
323
|
+
lines = Manifestation.export(role: 'User')
|
324
|
+
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
325
|
+
expect(csv['manifestation_custom_property_1'].compact).to be_empty
|
326
|
+
expect(csv['item_custom_property_2'].compact).to be_empty
|
302
327
|
end
|
303
328
|
end
|
304
329
|
end
|
@@ -317,7 +342,6 @@ end
|
|
317
342
|
# date_copyrighted :datetime
|
318
343
|
# created_at :datetime
|
319
344
|
# updated_at :datetime
|
320
|
-
# deleted_at :datetime
|
321
345
|
# access_address :string
|
322
346
|
# language_id :integer default(1), not null
|
323
347
|
# carrier_type_id :integer default(1), not null
|