enju_library 0.2.0.beta.9 → 0.2.0.beta.10

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/library_group.rb +8 -2
  3. data/app/views/libraries/index.html.erb +2 -2
  4. data/app/views/libraries/show.html.erb +1 -1
  5. data/app/views/library_groups/_form.html.erb +1 -1
  6. data/app/views/user_import_results/index.html.erb +2 -2
  7. data/config/locales/translation_en.yml +3 -0
  8. data/config/locales/translation_ja.yml +3 -0
  9. data/db/migrate/059_create_libraries.rb +7 -9
  10. data/db/migrate/069_create_shelves.rb +3 -4
  11. data/db/migrate/080_create_library_groups.rb +2 -3
  12. data/db/migrate/120_create_baskets.rb +2 -3
  13. data/db/migrate/20081006090811_create_subscriptions.rb +4 -7
  14. data/db/migrate/20081006093246_create_subscribes.rb +4 -5
  15. data/db/migrate/20120319173203_create_accepts.rb +3 -6
  16. data/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  17. data/db/migrate/20140110131010_create_user_import_results.rb +2 -2
  18. data/db/migrate/20140524074813_create_user_import_file_transitions.rb +1 -2
  19. data/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  20. data/db/migrate/20140709113905_create_user_export_file_transitions.rb +1 -1
  21. data/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  22. data/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  23. data/db/migrate/20140821151023_create_colors.rb +1 -3
  24. data/db/migrate/20150924115059_create_withdraws.rb +3 -5
  25. data/db/migrate/20151213070943_add_translation_table_to_library_group.rb +19 -6
  26. data/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +15 -2
  27. data/lib/enju_library/version.rb +1 -1
  28. data/spec/controllers/budget_types_controller_spec.rb +2 -1
  29. data/spec/dummy/config/application.rb +1 -0
  30. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  31. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  32. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  33. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
  34. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
  35. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
  36. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
  37. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
  38. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
  39. data/spec/dummy/db/schema.rb +28 -6
  40. data/spec/models/user_import_file_spec.rb +0 -1
  41. data/spec/models/withdraw_spec.rb +6 -0
  42. data/spec/views/library_groups/edit.html.erb_spec.rb +5 -1
  43. metadata +348 -318
@@ -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: 20160814165332) do
14
+ ActiveRecord::Schema.define(version: 20160820004638) 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: 20160814165332) 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: 20160814165332) 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"
@@ -158,12 +160,14 @@ ActiveRecord::Schema.define(version: 20160814165332) do
158
160
  t.string "birth_date"
159
161
  t.string "death_date"
160
162
  t.string "agent_identifier"
163
+ t.integer "profile_id"
161
164
  end
162
165
 
163
166
  add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
164
167
  add_index "agents", ["country_id"], name: "index_agents_on_country_id"
165
168
  add_index "agents", ["full_name"], name: "index_agents_on_full_name"
166
169
  add_index "agents", ["language_id"], name: "index_agents_on_language_id"
170
+ add_index "agents", ["profile_id"], name: "index_agents_on_profile_id"
167
171
  add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
168
172
 
169
173
  create_table "baskets", force: :cascade do |t|
@@ -260,12 +264,16 @@ ActiveRecord::Schema.define(version: 20160814165332) do
260
264
  add_index "carrier_type_has_checkout_types", ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
261
265
 
262
266
  create_table "carrier_types", force: :cascade do |t|
263
- t.string "name", null: false
267
+ t.string "name", null: false
264
268
  t.text "display_name"
265
269
  t.text "note"
266
270
  t.integer "position"
267
271
  t.datetime "created_at"
268
272
  t.datetime "updated_at"
273
+ t.string "attachment_file_name"
274
+ t.string "attachment_content_type"
275
+ t.integer "attachment_file_size"
276
+ t.datetime "attachment_updated_at"
269
277
  end
270
278
 
271
279
  create_table "checked_items", force: :cascade do |t|
@@ -611,6 +619,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
611
619
  t.integer "import_request_id"
612
620
  t.datetime "created_at"
613
621
  t.datetime "updated_at"
622
+ t.boolean "most_recent"
614
623
  end
615
624
 
616
625
  add_index "import_request_transitions", ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
@@ -717,7 +726,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
717
726
  t.text "note"
718
727
  t.integer "call_number_rows", default: 1, null: false
719
728
  t.string "call_number_delimiter", default: "|", null: false
720
- t.integer "library_group_id", default: 1, null: false
729
+ t.integer "library_group_id", null: false
721
730
  t.integer "users_count", default: 0, null: false
722
731
  t.integer "position"
723
732
  t.integer "country_id"
@@ -731,7 +740,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
731
740
  end
732
741
 
733
742
  add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
734
- add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
743
+ add_index "libraries", ["name"], name: "index_libraries_on_name"
735
744
 
736
745
  create_table "library_group_translations", force: :cascade do |t|
737
746
  t.integer "library_group_id", null: false
@@ -897,7 +906,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
897
906
  t.datetime "valid_until"
898
907
  t.datetime "date_submitted"
899
908
  t.datetime "date_accepted"
900
- t.datetime "date_caputured"
909
+ t.datetime "date_captured"
901
910
  t.string "pub_date"
902
911
  t.string "edition_string"
903
912
  t.integer "volume_number"
@@ -1037,6 +1046,8 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1037
1046
  t.datetime "picture_updated_at"
1038
1047
  t.text "picture_meta"
1039
1048
  t.string "picture_fingerprint"
1049
+ t.integer "picture_width"
1050
+ t.integer "picture_height"
1040
1051
  end
1041
1052
 
1042
1053
  add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
@@ -1193,6 +1204,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1193
1204
  t.integer "resource_export_file_id"
1194
1205
  t.datetime "created_at"
1195
1206
  t.datetime "updated_at"
1207
+ t.boolean "most_recent"
1196
1208
  end
1197
1209
 
1198
1210
  add_index "resource_export_file_transitions", ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
@@ -1216,6 +1228,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1216
1228
  t.integer "resource_import_file_id"
1217
1229
  t.datetime "created_at"
1218
1230
  t.datetime "updated_at"
1231
+ t.boolean "most_recent"
1219
1232
  end
1220
1233
 
1221
1234
  add_index "resource_import_file_transitions", ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
@@ -1353,7 +1366,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1353
1366
  t.string "name", null: false
1354
1367
  t.text "display_name"
1355
1368
  t.text "note"
1356
- t.integer "library_id", default: 1, null: false
1369
+ t.integer "library_id", null: false
1357
1370
  t.integer "items_count", default: 0, null: false
1358
1371
  t.integer "position"
1359
1372
  t.datetime "created_at"
@@ -1457,6 +1470,7 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1457
1470
 
1458
1471
  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
1459
1472
  add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
1473
+ add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1460
1474
 
1461
1475
  create_table "user_export_files", force: :cascade do |t|
1462
1476
  t.integer "user_id"
@@ -1469,6 +1483,8 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1469
1483
  t.datetime "updated_at"
1470
1484
  end
1471
1485
 
1486
+ add_index "user_export_files", ["user_id"], name: "index_user_export_files_on_user_id"
1487
+
1472
1488
  create_table "user_group_has_checkout_types", force: :cascade do |t|
1473
1489
  t.integer "user_group_id", null: false
1474
1490
  t.integer "checkout_type_id", null: false
@@ -1545,6 +1561,8 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1545
1561
  t.integer "default_user_group_id"
1546
1562
  end
1547
1563
 
1564
+ add_index "user_import_files", ["user_id"], name: "index_user_import_files_on_user_id"
1565
+
1548
1566
  create_table "user_import_results", force: :cascade do |t|
1549
1567
  t.integer "user_import_file_id"
1550
1568
  t.integer "user_id"
@@ -1554,6 +1572,9 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1554
1572
  t.text "error_message"
1555
1573
  end
1556
1574
 
1575
+ add_index "user_import_results", ["user_id"], name: "index_user_import_results_on_user_id"
1576
+ add_index "user_import_results", ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1577
+
1557
1578
  create_table "user_reserve_stat_transitions", force: :cascade do |t|
1558
1579
  t.string "to_state"
1559
1580
  t.text "metadata", default: "{}"
@@ -1632,5 +1653,6 @@ ActiveRecord::Schema.define(version: 20160814165332) do
1632
1653
 
1633
1654
  add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
1634
1655
  add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
1656
+ add_index "withdraws", ["librarian_id"], name: "index_withdraws_on_librarian_id"
1635
1657
 
1636
1658
  end
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  require 'rails_helper'
3
2
 
4
3
  describe UserImportFile do
@@ -8,6 +8,12 @@ RSpec.describe Withdraw, type: :model do
8
8
  withdraw.item.circulation_status.name.should eq 'Removed'
9
9
  withdraw.item.use_restriction.name.should eq 'Not For Loan'
10
10
  end
11
+
12
+ it "should not withdraw rented item" do
13
+ withdraw = Withdraw.new(librarian: users(:librarian1))
14
+ withdraw.item = items(:item_00013)
15
+ withdraw.valid?.should be_falsy
16
+ end
11
17
  end
12
18
 
13
19
  # == Schema Information
@@ -7,7 +7,11 @@ describe "library_groups/edit" do
7
7
  @countries = Country.all
8
8
  end
9
9
 
10
- it "renders attributes in <p>" do
10
+ it "renders selector for multilpe book jacket sources." do
11
11
  render
12
+ expect(rendered).to have_css "select#library_group_book_jacket_source"
13
+ expect(rendered).to have_css "select#library_group_book_jacket_source option", minimum: 2
14
+ expect(rendered).to have_css 'select#library_group_book_jacket_source option[value="google"]'
15
+ expect(rendered).to have_css 'select#library_group_book_jacket_source option[value="hanmotocom"]'
12
16
  end
13
17
  end