enju_biblio 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/picture_files_controller.rb +1 -1
  3. data/app/models/item.rb +1 -1
  4. data/app/models/manifestation.rb +22 -2
  5. data/app/models/resource_import_file.rb +4 -4
  6. data/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  7. data/lib/enju_biblio/version.rb +1 -1
  8. data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +38 -655
  9. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/should_import_without_errors.yml +43 -191
  10. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +40 -592
  11. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +37 -589
  12. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +41 -593
  13. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +39 -591
  14. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +39 -591
  15. data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +40 -425
  16. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +39 -75
  17. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +39 -705
  18. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +39 -424
  19. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +37 -422
  20. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_searchable_right_after_the_import.yml +41 -426
  21. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +39 -424
  22. data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
  23. data/spec/controllers/agent_merges_controller_spec.rb +13 -13
  24. data/spec/controllers/agent_relationship_types_controller_spec.rb +12 -12
  25. data/spec/controllers/agent_relationships_controller_spec.rb +12 -12
  26. data/spec/controllers/agent_types_controller_spec.rb +1 -1
  27. data/spec/controllers/agents_controller_spec.rb +6 -6
  28. data/spec/controllers/carrier_types_controller_spec.rb +1 -1
  29. data/spec/controllers/content_types_controller_spec.rb +3 -3
  30. data/spec/controllers/countries_controller_spec.rb +9 -9
  31. data/spec/controllers/create_types_controller_spec.rb +1 -1
  32. data/spec/controllers/creates_controller_spec.rb +11 -11
  33. data/spec/controllers/donates_controller_spec.rb +11 -11
  34. data/spec/controllers/form_of_works_controller_spec.rb +1 -1
  35. data/spec/controllers/frequencies_controller_spec.rb +3 -3
  36. data/spec/controllers/identifier_types_controller_spec.rb +1 -1
  37. data/spec/controllers/import_requests_controller_spec.rb +5 -5
  38. data/spec/controllers/items_controller_spec.rb +15 -15
  39. data/spec/controllers/languages_controller_spec.rb +6 -6
  40. data/spec/controllers/licenses_controller_spec.rb +1 -1
  41. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +12 -12
  42. data/spec/controllers/manifestation_relationships_controller_spec.rb +12 -12
  43. data/spec/controllers/manifestations_controller_spec.rb +29 -29
  44. data/spec/controllers/medium_of_performances_controller_spec.rb +1 -1
  45. data/spec/controllers/owns_controller_spec.rb +12 -12
  46. data/spec/controllers/produce_types_controller_spec.rb +1 -1
  47. data/spec/controllers/produces_controller_spec.rb +10 -10
  48. data/spec/controllers/realize_types_controller_spec.rb +1 -1
  49. data/spec/controllers/realizes_controller_spec.rb +11 -11
  50. data/spec/controllers/series_statement_merge_lists_controller_spec.rb +12 -12
  51. data/spec/controllers/series_statement_merges_controller_spec.rb +12 -12
  52. data/spec/controllers/series_statements_controller_spec.rb +11 -11
  53. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  54. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  55. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  56. data/spec/dummy/db/schema.rb +7 -3
  57. data/spec/factories/agent.rb +2 -2
  58. data/spec/factories/agent_merge.rb +3 -3
  59. data/spec/factories/agent_merge_list.rb +1 -1
  60. data/spec/factories/basket.rb +2 -2
  61. data/spec/factories/carrier_type.rb +1 -1
  62. data/spec/factories/checkout.rb +1 -1
  63. data/spec/factories/classification.rb +2 -2
  64. data/spec/factories/classification_type.rb +1 -1
  65. data/spec/factories/content_type.rb +1 -1
  66. data/spec/factories/country.rb +1 -1
  67. data/spec/factories/create.rb +3 -3
  68. data/spec/factories/create_types.rb +1 -1
  69. data/spec/factories/donate.rb +3 -3
  70. data/spec/factories/form_of_work.rb +1 -1
  71. data/spec/factories/frequency.rb +1 -1
  72. data/spec/factories/identifier.rb +2 -2
  73. data/spec/factories/identifier_type.rb +1 -1
  74. data/spec/factories/import_request.rb +1 -1
  75. data/spec/factories/item.rb +2 -2
  76. data/spec/factories/language.rb +1 -1
  77. data/spec/factories/library.rb +2 -2
  78. data/spec/factories/license.rb +1 -1
  79. data/spec/factories/manifestation.rb +2 -2
  80. data/spec/factories/manifestation_relationship.rb +3 -3
  81. data/spec/factories/manifestation_relationship_type.rb +1 -1
  82. data/spec/factories/medium_of_performance.rb +1 -1
  83. data/spec/factories/own.rb +3 -3
  84. data/spec/factories/patron_relationship.rb +3 -3
  85. data/spec/factories/patron_relationship_type.rb +1 -1
  86. data/spec/factories/patron_type.rb +1 -1
  87. data/spec/factories/produce.rb +3 -3
  88. data/spec/factories/produce_types.rb +1 -1
  89. data/spec/factories/profile.rb +2 -2
  90. data/spec/factories/realize.rb +3 -3
  91. data/spec/factories/realize_types.rb +1 -1
  92. data/spec/factories/reserve.rb +5 -5
  93. data/spec/factories/role.rb +1 -1
  94. data/spec/factories/series_has_manifestation.rb +3 -3
  95. data/spec/factories/series_statement.rb +2 -2
  96. data/spec/factories/series_statement_merge.rb +3 -3
  97. data/spec/factories/series_statement_merge_list.rb +1 -1
  98. data/spec/factories/series_statement_relationship.rb +3 -3
  99. data/spec/factories/shelf.rb +2 -2
  100. data/spec/factories/subject.rb +3 -3
  101. data/spec/factories/subject_heading_type.rb +1 -1
  102. data/spec/factories/subject_heading_type_has_subject.rb +3 -3
  103. data/spec/factories/subject_type.rb +1 -1
  104. data/spec/factories/user.rb +1 -1
  105. data/spec/fixtures/items.yml +1 -1
  106. data/spec/fixtures/library_groups.yml +1 -1
  107. data/spec/models/agent_spec.rb +4 -4
  108. data/spec/models/create_type_spec.rb +1 -1
  109. data/spec/models/item_spec.rb +1 -1
  110. data/spec/models/manifestation_spec.rb +30 -6
  111. data/spec/models/produce_type_spec.rb +1 -1
  112. data/spec/models/realize_type_spec.rb +1 -1
  113. data/spec/models/resource_export_file_spec.rb +7 -7
  114. data/spec/models/resource_import_file_spec.rb +19 -0
  115. data/spec/models/series_statement_spec.rb +1 -1
  116. data/spec/policies/manifestation_policy_spec.rb +5 -5
  117. data/spec/rails_helper.rb +3 -3
  118. data/spec/support/controller_macros.rb +3 -3
  119. data/spec/views/items/index.html.erb_spec.rb +2 -2
  120. data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
  121. data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -1
  122. data/spec/views/manifestations/index.txt.erb_spec.rb +2 -2
  123. data/spec/views/manifestations/show.html.erb_spec.rb +5 -5
  124. data/spec/views/manifestations/show.txt.erb_spec.rb +1 -1
  125. data/spec/views/series_statement_merges/show.html.erb_spec.rb +1 -1
  126. metadata +23 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '0785940d4a8dcfe3c9e349ce3dec613a89a2969d'
4
- data.tar.gz: aa2203a5c519a56368ef69c67f540f2b55ca8def
3
+ metadata.gz: d2f12a2708c3326ac6d4ef0bbc4a62a8c0d656c8
4
+ data.tar.gz: 9d6e7a191c6ce4bab308b751a2183e960b015efe
5
5
  SHA512:
6
- metadata.gz: 9411c7b99237bf3e84b1a2196351dc10d67f295d6adf7c8e260852cc80c555f8166974c2d91d54c29c3820ee01067fe75113a2b81a6e19581bb1e1169d370596
7
- data.tar.gz: c6dda1dff919d4a866c32aeae49c78ece33b1ab3146cf0938374cd4392746e924608b5e7ea94a02c22e5ee44828fd6fe2257ea861c603ddc008aef4268e6fd2a
6
+ metadata.gz: ce432c54b88f2411c4b39edf21dd724f23757fca0b2cb8ebe96aa28fb121a7fb7f06ce47f3b256f663d40da9bae8ce40232c852efa61f2759b03ff77c14fa562
7
+ data.tar.gz: 2c5750574eb3df90f4bd4a881f69563ea2a633ef996e6d0d96518a401888593cd1d246bf69e41eab19afb6970bfd335cfbf606ab31bd28d46c52f7471c98a833
@@ -31,7 +31,7 @@ class PictureFilesController < ApplicationController
31
31
  size = 'medium'
32
32
  end
33
33
 
34
- if @picture_file.picture.path
34
+ if @picture_file.picture.exists?
35
35
  if ENV['ENJU_STORAGE'] == 's3'
36
36
  file = Faraday.get(@picture_file.picture.expiring_url).body.force_encoding('UTF-8')
37
37
  else
data/app/models/item.rb CHANGED
@@ -118,5 +118,5 @@ end
118
118
  # binding_item_identifier :string
119
119
  # binding_call_number :string
120
120
  # binded_at :datetime
121
- # manifestation_id :integer
121
+ # manifestation_id :integer not null
122
122
  #
@@ -539,12 +539,18 @@ class Manifestation < ActiveRecord::Base
539
539
  manifestation_updated_at
540
540
  manifestation_identifier
541
541
  access_address
542
+ description
542
543
  note
543
544
  extent
544
545
  dimensions
545
546
  carrier_type
546
547
  edition
547
548
  edition_string
549
+ volume_number
550
+ volume_number_string
551
+ issue_number
552
+ issue_number_string
553
+ serial_number
548
554
  )
549
555
 
550
556
  header += IdentifierType.order(:position).pluck(:name)
@@ -557,6 +563,7 @@ class Manifestation < ActiveRecord::Base
557
563
  item_id
558
564
  item_identifier
559
565
  call_number
566
+ item_note
560
567
  )
561
568
  case role.to_sym
562
569
  when :Administrator, :Librarian
@@ -615,12 +622,18 @@ class Manifestation < ActiveRecord::Base
615
622
  item_lines << updated_at
616
623
  item_lines << manifestation_identifier
617
624
  item_lines << access_address
618
- item_lines << note
625
+ item_lines << description.try(:gsub, /\r?\n/, '\n')
626
+ item_lines << note.try(:gsub, /\r?\n/, '\n')
619
627
  item_lines << extent
620
628
  item_lines << dimensions
621
629
  item_lines << carrier_type.name
622
630
  item_lines << edition
623
631
  item_lines << edition_string
632
+ item_lines << volume_number
633
+ item_lines << volume_number_string
634
+ item_lines << issue_number
635
+ item_lines << issue_number_string
636
+ item_lines << serial_number
624
637
 
625
638
  IdentifierType.order(:position).pluck(:name).each do |identifier_type|
626
639
  if identifier_contents(identifier_type.to_sym).first
@@ -649,6 +662,7 @@ class Manifestation < ActiveRecord::Base
649
662
  item_lines << i.id
650
663
  item_lines << i.item_identifier
651
664
  item_lines << i.call_number
665
+ item_lines << i.note.try(:gsub, /\r?\n/, '\n')
652
666
  case options[:role].to_sym
653
667
  when :Administrator, :Librarian
654
668
  item_lines << i.price
@@ -695,12 +709,18 @@ class Manifestation < ActiveRecord::Base
695
709
  line << updated_at
696
710
  line << manifestation_identifier
697
711
  line << access_address
698
- line << note
712
+ line << description.try(:gsub, /\r?\n/, '\n')
713
+ line << note.try(:gsub, /\r?\n/, '\n')
699
714
  line << extent
700
715
  line << dimensions
701
716
  line << carrier_type.name
702
717
  line << edition
703
718
  line << edition_string
719
+ line << volume_number
720
+ line << volume_number_string
721
+ line << issue_number
722
+ line << issue_number_string
723
+ line << serial_number
704
724
 
705
725
  IdentifierType.order(:position).pluck(:name).each do |identifier_type|
706
726
  if identifier_contents(identifier_type.to_sym).first
@@ -338,7 +338,7 @@ class ResourceImportFile < ActiveRecord::Base
338
338
  end
339
339
 
340
340
  item.price = row['item_price'] if row['item_price'].present?
341
- item.note = row['item_note'] if row['item_note'].present?
341
+ item.note = row['item_note'].try(:gsub, /\\n/, "\n") if row['item_note'].present?
342
342
  item.url = row['item_url'] if row['item_url'].present?
343
343
 
344
344
  if row['include_supplements']
@@ -522,7 +522,7 @@ class ResourceImportFile < ActiveRecord::Base
522
522
  binding_call_number: row['binding_call_number'],
523
523
  binded_at: binded_at,
524
524
  url: row['item_url'],
525
- note: row['item_note']
525
+ note: row['item_note'].try(:gsub, /\\n/, "\n")
526
526
  )
527
527
  manifestation.items << item
528
528
  if defined?(EnjuCirculation)
@@ -641,9 +641,9 @@ class ResourceImportFile < ActiveRecord::Base
641
641
  :depth => row['depth'],
642
642
  :height => row['height'],
643
643
  :price => row['manifestation_price'],
644
- :description => row['description'],
644
+ :description => row['description'].try(:gsub, /\\n/, "\n"),
645
645
  #:description_transcription => row['description_transcription'],
646
- :note => row['note'],
646
+ :note => row['note'].try(:gsub, /\\n/, "\n"),
647
647
  :statement_of_responsibility => row['statement_of_responsibility'],
648
648
  :access_address => row['access_address'],
649
649
  :manifestation_identifier => row['manifestation_identifier'],
@@ -0,0 +1,5 @@
1
+ class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration
2
+ def change
3
+ change_column_null :items, :manifestation_id, false
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end