enju_purchase_request 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/order_list.rb +1 -1
- data/app/models/order_list_transition.rb +1 -1
- data/db/migrate/20180107155817_add_constraints_to_most_recent_for_order_list_transitions.rb +13 -0
- data/lib/enju_purchase_request/version.rb +1 -1
- data/lib/generators/enju_purchase_request/setup/setup_generator.rb +1 -0
- data/lib/generators/enju_purchase_request/update/update_generator.rb +8 -0
- data/spec/controllers/order_lists_controller_spec.rb +33 -33
- data/spec/controllers/orders_controller_spec.rb +34 -34
- data/spec/controllers/purchase_requests_controller_spec.rb +4 -4
- data/spec/dummy/db/migrate/005_create_manifestations.rb +0 -1
- data/spec/dummy/db/migrate/059_create_libraries.rb +7 -9
- data/spec/dummy/db/migrate/069_create_shelves.rb +3 -4
- data/spec/dummy/db/migrate/080_create_library_groups.rb +2 -3
- data/spec/dummy/db/migrate/120_create_baskets.rb +2 -3
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +4 -7
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +4 -5
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +0 -1
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +3 -6
- data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +2 -2
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -2
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +5 -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 +1 -1
- 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 -3
- data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +5 -0
- data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +9 -0
- data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +3 -5
- data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +19 -6
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +15 -2
- data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
- data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
- data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
- data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
- data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
- data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
- data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
- data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
- data/spec/dummy/db/schema.rb +42 -12
- data/spec/factories/bookstore.rb +1 -1
- data/spec/factories/library.rb +2 -2
- data/spec/factories/order.rb +3 -3
- data/spec/factories/order_list.rb +3 -3
- data/spec/factories/profile.rb +1 -1
- data/spec/factories/purchase_request.rb +2 -2
- data/spec/factories/user.rb +1 -1
- data/spec/fixtures/library_groups.yml +1 -1
- data/spec/fixtures/order_list_transitions.yml +1 -1
- data/spec/rails_helper.rb +3 -3
- data/spec/support/controller_macros.rb +3 -3
- metadata +222 -240
@@ -1,9 +1,22 @@
|
|
1
|
+
# This migration comes from enju_library_engine (originally 20151213072705)
|
1
2
|
class AddFooterBannerToLibraryGroup < ActiveRecord::Migration
|
2
3
|
def up
|
3
|
-
|
4
|
+
if defined?(Globalize)
|
5
|
+
LibraryGroup.add_translation_fields! footer_banner: :text
|
6
|
+
end
|
7
|
+
|
8
|
+
if defined?(AwesomeHstoreTranslate)
|
9
|
+
add_column :library_groups, :footer_banner, :hstore
|
10
|
+
end
|
4
11
|
end
|
5
12
|
|
6
13
|
def down
|
7
|
-
|
14
|
+
if defined?(Globalize)
|
15
|
+
remove_column :library_group_translations, :footer_banner
|
16
|
+
end
|
17
|
+
|
18
|
+
if defined?(AwesomeHstoreTranslate)
|
19
|
+
remove_column :library_groups, :footer_banner
|
20
|
+
end
|
8
21
|
end
|
9
22
|
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20180107155817) do
|
15
15
|
|
16
16
|
create_table "accepts", force: :cascade do |t|
|
17
17
|
t.integer "basket_id"
|
@@ -23,6 +23,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
23
23
|
|
24
24
|
add_index "accepts", ["basket_id"], name: "index_accepts_on_basket_id"
|
25
25
|
add_index "accepts", ["item_id"], name: "index_accepts_on_item_id"
|
26
|
+
add_index "accepts", ["librarian_id"], name: "index_accepts_on_librarian_id"
|
26
27
|
|
27
28
|
create_table "agent_import_file_transitions", force: :cascade do |t|
|
28
29
|
t.string "to_state"
|
@@ -31,6 +32,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
31
32
|
t.integer "agent_import_file_id"
|
32
33
|
t.datetime "created_at"
|
33
34
|
t.datetime "updated_at"
|
35
|
+
t.boolean "most_recent"
|
34
36
|
end
|
35
37
|
|
36
38
|
add_index "agent_import_file_transitions", ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
|
@@ -61,7 +63,6 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
61
63
|
create_table "agent_import_results", force: :cascade do |t|
|
62
64
|
t.integer "agent_import_file_id"
|
63
65
|
t.integer "agent_id"
|
64
|
-
t.integer "user_id"
|
65
66
|
t.text "body"
|
66
67
|
t.datetime "created_at"
|
67
68
|
t.datetime "updated_at"
|
@@ -159,12 +160,14 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
159
160
|
t.string "birth_date"
|
160
161
|
t.string "death_date"
|
161
162
|
t.string "agent_identifier"
|
163
|
+
t.integer "profile_id"
|
162
164
|
end
|
163
165
|
|
164
166
|
add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
|
165
167
|
add_index "agents", ["country_id"], name: "index_agents_on_country_id"
|
166
168
|
add_index "agents", ["full_name"], name: "index_agents_on_full_name"
|
167
169
|
add_index "agents", ["language_id"], name: "index_agents_on_language_id"
|
170
|
+
add_index "agents", ["profile_id"], name: "index_agents_on_profile_id"
|
168
171
|
add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
|
169
172
|
|
170
173
|
create_table "baskets", force: :cascade do |t|
|
@@ -250,12 +253,16 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
250
253
|
end
|
251
254
|
|
252
255
|
create_table "carrier_types", force: :cascade do |t|
|
253
|
-
t.string "name",
|
256
|
+
t.string "name", null: false
|
254
257
|
t.text "display_name"
|
255
258
|
t.text "note"
|
256
259
|
t.integer "position"
|
257
260
|
t.datetime "created_at"
|
258
261
|
t.datetime "updated_at"
|
262
|
+
t.string "attachment_file_name"
|
263
|
+
t.string "attachment_content_type"
|
264
|
+
t.integer "attachment_file_size"
|
265
|
+
t.datetime "attachment_updated_at"
|
259
266
|
end
|
260
267
|
|
261
268
|
create_table "colors", force: :cascade do |t|
|
@@ -391,6 +398,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
391
398
|
t.integer "import_request_id"
|
392
399
|
t.datetime "created_at"
|
393
400
|
t.datetime "updated_at"
|
401
|
+
t.boolean "most_recent"
|
394
402
|
end
|
395
403
|
|
396
404
|
add_index "import_request_transitions", ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
|
@@ -428,7 +436,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
428
436
|
t.string "binding_item_identifier"
|
429
437
|
t.string "binding_call_number"
|
430
438
|
t.datetime "binded_at"
|
431
|
-
t.integer "manifestation_id"
|
439
|
+
t.integer "manifestation_id", null: false
|
432
440
|
end
|
433
441
|
|
434
442
|
add_index "items", ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
|
@@ -468,7 +476,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
468
476
|
t.text "note"
|
469
477
|
t.integer "call_number_rows", default: 1, null: false
|
470
478
|
t.string "call_number_delimiter", default: "|", null: false
|
471
|
-
t.integer "library_group_id",
|
479
|
+
t.integer "library_group_id", null: false
|
472
480
|
t.integer "users_count", default: 0, null: false
|
473
481
|
t.integer "position"
|
474
482
|
t.integer "country_id"
|
@@ -482,7 +490,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
482
490
|
end
|
483
491
|
|
484
492
|
add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
|
485
|
-
add_index "libraries", ["name"], name: "index_libraries_on_name"
|
493
|
+
add_index "libraries", ["name"], name: "index_libraries_on_name"
|
486
494
|
|
487
495
|
create_table "library_group_translations", force: :cascade do |t|
|
488
496
|
t.integer "library_group_id", null: false
|
@@ -501,7 +509,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
501
509
|
t.text "display_name"
|
502
510
|
t.string "short_name", null: false
|
503
511
|
t.text "my_networks"
|
504
|
-
t.text "
|
512
|
+
t.text "old_login_banner"
|
505
513
|
t.text "note"
|
506
514
|
t.integer "country_id"
|
507
515
|
t.integer "position"
|
@@ -516,6 +524,12 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
516
524
|
t.boolean "family_name_first", default: true
|
517
525
|
t.integer "pub_year_facet_range_interval", default: 10
|
518
526
|
t.integer "user_id"
|
527
|
+
t.boolean "csv_charset_conversion", default: false, null: false
|
528
|
+
t.string "header_logo_file_name"
|
529
|
+
t.string "header_logo_content_type"
|
530
|
+
t.integer "header_logo_file_size"
|
531
|
+
t.datetime "header_logo_updated_at"
|
532
|
+
t.text "header_logo_meta"
|
519
533
|
end
|
520
534
|
|
521
535
|
add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
|
@@ -565,7 +579,6 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
565
579
|
t.string "access_address"
|
566
580
|
t.integer "language_id", default: 1, null: false
|
567
581
|
t.integer "carrier_type_id", default: 1, null: false
|
568
|
-
t.integer "extent_id", default: 1, null: false
|
569
582
|
t.integer "start_page"
|
570
583
|
t.integer "end_page"
|
571
584
|
t.integer "height"
|
@@ -595,7 +608,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
595
608
|
t.datetime "valid_until"
|
596
609
|
t.datetime "date_submitted"
|
597
610
|
t.datetime "date_accepted"
|
598
|
-
t.datetime "
|
611
|
+
t.datetime "date_captured"
|
599
612
|
t.string "pub_date"
|
600
613
|
t.string "edition_string"
|
601
614
|
t.integer "volume_number"
|
@@ -607,9 +620,11 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
607
620
|
t.integer "month_of_publication"
|
608
621
|
t.boolean "fulltext_content"
|
609
622
|
t.string "doi"
|
610
|
-
t.boolean "
|
623
|
+
t.boolean "serial"
|
611
624
|
t.text "statement_of_responsibility"
|
612
625
|
t.text "publication_place"
|
626
|
+
t.text "extent"
|
627
|
+
t.text "dimensions"
|
613
628
|
end
|
614
629
|
|
615
630
|
add_index "manifestations", ["access_address"], name: "index_manifestations_on_access_address"
|
@@ -703,9 +718,10 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
703
718
|
t.integer "order_list_id"
|
704
719
|
t.datetime "created_at"
|
705
720
|
t.datetime "updated_at"
|
706
|
-
t.boolean "most_recent"
|
721
|
+
t.boolean "most_recent", null: false
|
707
722
|
end
|
708
723
|
|
724
|
+
add_index "order_list_transitions", ["order_list_id", "most_recent"], name: "index_order_list_transitions_parent_most_recent", unique: true
|
709
725
|
add_index "order_list_transitions", ["order_list_id"], name: "index_order_list_transitions_on_order_list_id"
|
710
726
|
add_index "order_list_transitions", ["sort_key", "order_list_id"], name: "index_order_list_transitions_on_sort_key_and_order_list_id", unique: true
|
711
727
|
|
@@ -761,6 +777,8 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
761
777
|
t.datetime "picture_updated_at"
|
762
778
|
t.text "picture_meta"
|
763
779
|
t.string "picture_fingerprint"
|
780
|
+
t.integer "picture_width"
|
781
|
+
t.integer "picture_height"
|
764
782
|
end
|
765
783
|
|
766
784
|
add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
|
@@ -873,6 +891,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
873
891
|
t.integer "resource_export_file_id"
|
874
892
|
t.datetime "created_at"
|
875
893
|
t.datetime "updated_at"
|
894
|
+
t.boolean "most_recent"
|
876
895
|
end
|
877
896
|
|
878
897
|
add_index "resource_export_file_transitions", ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
|
@@ -896,6 +915,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
896
915
|
t.integer "resource_import_file_id"
|
897
916
|
t.datetime "created_at"
|
898
917
|
t.datetime "updated_at"
|
918
|
+
t.boolean "most_recent"
|
899
919
|
end
|
900
920
|
|
901
921
|
add_index "resource_import_file_transitions", ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
|
@@ -931,6 +951,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
931
951
|
t.text "body"
|
932
952
|
t.datetime "created_at"
|
933
953
|
t.datetime "updated_at"
|
954
|
+
t.text "error_message"
|
934
955
|
end
|
935
956
|
|
936
957
|
add_index "resource_import_results", ["item_id"], name: "index_resource_import_results_on_item_id"
|
@@ -1006,7 +1027,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
1006
1027
|
t.string "name", null: false
|
1007
1028
|
t.text "display_name"
|
1008
1029
|
t.text "note"
|
1009
|
-
t.integer "library_id",
|
1030
|
+
t.integer "library_id", null: false
|
1010
1031
|
t.integer "items_count", default: 0, null: false
|
1011
1032
|
t.integer "position"
|
1012
1033
|
t.datetime "created_at"
|
@@ -1078,6 +1099,7 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
1078
1099
|
|
1079
1100
|
add_index "user_export_file_transitions", ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
|
1080
1101
|
add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
|
1102
|
+
add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
|
1081
1103
|
|
1082
1104
|
create_table "user_export_files", force: :cascade do |t|
|
1083
1105
|
t.integer "user_id"
|
@@ -1090,6 +1112,8 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
1090
1112
|
t.datetime "updated_at"
|
1091
1113
|
end
|
1092
1114
|
|
1115
|
+
add_index "user_export_files", ["user_id"], name: "index_user_export_files_on_user_id"
|
1116
|
+
|
1093
1117
|
create_table "user_groups", force: :cascade do |t|
|
1094
1118
|
t.string "name"
|
1095
1119
|
t.text "display_name"
|
@@ -1143,6 +1167,8 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
1143
1167
|
t.integer "default_user_group_id"
|
1144
1168
|
end
|
1145
1169
|
|
1170
|
+
add_index "user_import_files", ["user_id"], name: "index_user_import_files_on_user_id"
|
1171
|
+
|
1146
1172
|
create_table "user_import_results", force: :cascade do |t|
|
1147
1173
|
t.integer "user_import_file_id"
|
1148
1174
|
t.integer "user_id"
|
@@ -1152,6 +1178,9 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
1152
1178
|
t.text "error_message"
|
1153
1179
|
end
|
1154
1180
|
|
1181
|
+
add_index "user_import_results", ["user_id"], name: "index_user_import_results_on_user_id"
|
1182
|
+
add_index "user_import_results", ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
|
1183
|
+
|
1155
1184
|
create_table "users", force: :cascade do |t|
|
1156
1185
|
t.string "email", default: "", null: false
|
1157
1186
|
t.string "encrypted_password", default: "", null: false
|
@@ -1201,5 +1230,6 @@ ActiveRecord::Schema.define(version: 20160815045420) do
|
|
1201
1230
|
|
1202
1231
|
add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
|
1203
1232
|
add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
|
1233
|
+
add_index "withdraws", ["librarian_id"], name: "index_withdraws_on_librarian_id"
|
1204
1234
|
|
1205
1235
|
end
|
data/spec/factories/bookstore.rb
CHANGED
data/spec/factories/library.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :library do |f|
|
3
3
|
f.sequence(:name){|n| "library#{n}"}
|
4
4
|
f.sequence(:short_display_name){|n| "library_#{n}"}
|
@@ -6,7 +6,7 @@ FactoryGirl.define do
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
|
9
|
+
FactoryBot.define do
|
10
10
|
factory :invalid_library, :class => Library do |f|
|
11
11
|
f.library_group_id{LibraryGroup.first.id}
|
12
12
|
end
|
data/spec/factories/order.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :order do |f|
|
3
|
-
f.order_list_id{
|
4
|
-
f.purchase_request_id{
|
3
|
+
f.order_list_id{FactoryBot.create(:order_list).id}
|
4
|
+
f.purchase_request_id{FactoryBot.create(:purchase_request).id}
|
5
5
|
end
|
6
6
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
|
1
|
+
FactoryBot.define do
|
2
2
|
factory :order_list do |f|
|
3
|
-
f.user_id{
|
3
|
+
f.user_id{FactoryBot.create(:user).id}
|
4
4
|
f.sequence(:title){|n| "order_list_#{n}"}
|
5
|
-
f.bookstore_id{
|
5
|
+
f.bookstore_id{FactoryBot.create(:bookstore).id}
|
6
6
|
end
|
7
7
|
end
|
data/spec/factories/profile.rb
CHANGED
data/spec/factories/user.rb
CHANGED