enju_biblio 0.1.3 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/app/controllers/agent_import_files_controller.rb +13 -3
- data/app/controllers/agent_import_results_controller.rb +12 -1
- data/app/controllers/agent_merge_lists_controller.rb +11 -1
- data/app/controllers/agent_merges_controller.rb +12 -2
- data/app/controllers/agent_relationship_types_controller.rb +13 -2
- data/app/controllers/agent_relationships_controller.rb +13 -4
- data/app/controllers/agent_types_controller.rb +13 -2
- data/app/controllers/agents_controller.rb +18 -12
- data/app/controllers/carrier_types_controller.rb +12 -2
- data/app/controllers/concerns/enju_biblio/controller.rb +99 -0
- data/app/controllers/content_types_controller.rb +12 -1
- data/app/controllers/countries_controller.rb +12 -1
- data/app/controllers/create_types_controller.rb +13 -2
- data/app/controllers/creates_controller.rb +13 -4
- data/app/controllers/donates_controller.rb +11 -1
- data/app/controllers/form_of_works_controller.rb +13 -2
- data/app/controllers/frequencies_controller.rb +13 -2
- data/app/controllers/identifier_types_controller.rb +13 -2
- data/app/controllers/import_requests_controller.rb +19 -9
- data/app/controllers/items_controller.rb +25 -13
- data/app/controllers/languages_controller.rb +12 -1
- data/app/controllers/licenses_controller.rb +13 -2
- data/app/controllers/manifestation_relationship_types_controller.rb +12 -1
- data/app/controllers/manifestation_relationships_controller.rb +13 -4
- data/app/controllers/manifestations_controller.rb +58 -30
- data/app/controllers/medium_of_performances_controller.rb +13 -2
- data/app/controllers/owns_controller.rb +12 -3
- data/app/controllers/picture_files_controller.rb +13 -3
- data/app/controllers/produce_types_controller.rb +13 -2
- data/app/controllers/produces_controller.rb +13 -4
- data/app/controllers/realize_types_controller.rb +13 -2
- data/app/controllers/realizes_controller.rb +13 -4
- data/app/controllers/resource_export_files_controller.rb +13 -3
- data/app/controllers/resource_import_files_controller.rb +14 -4
- data/app/controllers/resource_import_results_controller.rb +12 -1
- data/app/controllers/series_statement_merge_lists_controller.rb +11 -1
- data/app/controllers/series_statement_merges_controller.rb +12 -2
- data/app/controllers/series_statements_controller.rb +13 -5
- data/app/helpers/manifestations_helper.rb +8 -8
- data/app/jobs/agent_import_file_job.rb +7 -0
- data/app/jobs/resource_export_file_job.rb +7 -0
- data/app/jobs/resource_import_file_job.rb +7 -0
- data/app/models/agent.rb +23 -1
- data/app/models/agent_import_file.rb +0 -1
- data/app/models/carrier_type.rb +0 -1
- data/app/models/identifier.rb +1 -1
- data/app/models/item.rb +2 -9
- data/app/models/manifestation.rb +180 -75
- data/app/models/picture_file.rb +1 -1
- data/app/models/resource_export_file.rb +5 -3
- data/app/models/resource_import_file.rb +34 -50
- data/app/models/series_statement.rb +8 -1
- data/app/policies/agent_import_file_policy.rb +21 -0
- data/app/policies/agent_import_result_policy.rb +21 -0
- data/app/policies/agent_merge_list_policy.rb +25 -0
- data/app/policies/agent_merge_policy.rb +25 -0
- data/app/policies/agent_policy.rb +30 -0
- data/app/policies/agent_relationship_policy.rb +21 -0
- data/app/policies/agent_relationship_type_policy.rb +21 -0
- data/app/policies/agent_type_policy.rb +23 -0
- data/app/policies/carrier_type_policy.rb +23 -0
- data/app/policies/content_type_policy.rb +23 -0
- data/app/policies/country_policy.rb +21 -0
- data/app/policies/create_policy.rb +21 -0
- data/app/policies/create_type_policy.rb +21 -0
- data/app/policies/donate_policy.rb +21 -0
- data/app/policies/form_of_work_policy.rb +21 -0
- data/app/policies/frequency_policy.rb +23 -0
- data/app/policies/identifier_type_policy.rb +23 -0
- data/app/policies/import_request_policy.rb +21 -0
- data/app/policies/item_policy.rb +27 -0
- data/app/policies/language_policy.rb +21 -0
- data/app/policies/license_policy.rb +21 -0
- data/app/policies/manifestation_policy.rb +67 -0
- data/app/policies/manifestation_relationship_policy.rb +21 -0
- data/app/policies/manifestation_relationship_type_policy.rb +21 -0
- data/app/policies/medium_of_performance_policy.rb +21 -0
- data/app/policies/own_policy.rb +21 -0
- data/app/policies/picture_file_policy.rb +32 -0
- data/app/policies/produce_policy.rb +21 -0
- data/app/policies/produce_type_policy.rb +21 -0
- data/app/policies/realize_policy.rb +21 -0
- data/app/policies/realize_type_policy.rb +21 -0
- data/app/policies/resource_export_file_policy.rb +21 -0
- data/app/policies/resource_import_file_policy.rb +21 -0
- data/app/policies/resource_import_result_policy.rb +21 -0
- data/app/policies/series_statement_merge_list_policy.rb +25 -0
- data/app/policies/series_statement_merge_policy.rb +25 -0
- data/app/policies/series_statement_policy.rb +25 -0
- data/app/views/agent_relationship_types/index.html.erb +4 -4
- data/app/views/agent_types/index.html.erb +4 -4
- data/app/views/agent_types/show.html.erb +1 -1
- data/app/views/agents/_agent.html.erb +2 -2
- data/app/views/agents/_index.html.erb +1 -1
- data/app/views/agents/_index_agent.html.erb +4 -4
- data/app/views/agents/_index_agent_merge_list.html.erb +2 -2
- data/app/views/agents/_index_expression.html.erb +3 -3
- data/app/views/agents/_index_manifestation.html.erb +3 -3
- data/app/views/agents/_index_work.html.erb +3 -3
- data/app/views/agents/edit.html.erb +1 -1
- data/app/views/agents/{index.mobile.erb → index.html+phone.erb} +0 -0
- data/app/views/agents/index.json.jbuilder +5 -0
- data/app/views/agents/index.rss.builder +2 -2
- data/app/views/agents/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/agents/show.html.erb +3 -3
- data/app/views/carrier_types/_form.html.erb +1 -1
- data/app/views/carrier_types/index.html.erb +4 -4
- data/app/views/carrier_types/show.html.erb +1 -1
- data/app/views/content_types/index.html.erb +4 -4
- data/app/views/content_types/show.html.erb +1 -1
- data/app/views/countries/index.html.erb +3 -3
- data/app/views/countries/show.html.erb +1 -1
- data/app/views/create_types/index.html.erb +4 -4
- data/app/views/creates/_index.html.erb +2 -2
- data/app/views/creates/_index_agent.html.erb +3 -3
- data/app/views/creates/_index_work.html.erb +2 -2
- data/app/views/donates/index.html.erb +2 -2
- data/app/views/form_of_works/index.html.erb +4 -4
- data/app/views/form_of_works/show.html.erb +1 -1
- data/app/views/frequencies/index.html.erb +4 -4
- data/app/views/frequencies/show.html.erb +1 -1
- data/app/views/identifier_types/index.html.erb +4 -4
- data/app/views/identifier_types/show.html.erb +1 -1
- data/app/views/import_requests/index.html.erb +1 -1
- data/app/views/items/{_shelf_picture.mobile.erb → _shelf_picture.html+phone.erb} +0 -0
- data/app/views/items/edit.html.erb +2 -2
- data/app/views/items/{index.mobile.erb → index.html+phone.erb} +1 -1
- data/app/views/items/index.html.erb +2 -2
- data/app/views/items/new.html.erb +1 -5
- data/app/views/items/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/items/show.html.erb +10 -6
- data/app/views/languages/index.html.erb +3 -3
- data/app/views/languages/show.html.erb +1 -1
- data/app/views/layouts/{agents.mobile.erb → agents.html+phone.erb} +1 -1
- data/app/views/layouts/agents.html.erb +2 -2
- data/app/views/layouts/{manifestations.mobile.erb → manifestations.html+phone.erb} +1 -1
- data/app/views/layouts/manifestations.html.erb +2 -2
- data/app/views/licenses/index.html.erb +4 -4
- data/app/views/manifestation_relationship_types/index.html.erb +4 -4
- data/app/views/manifestations/_attachment_file.html.erb +1 -1
- data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
- data/app/views/manifestations/_classification_facet.html.erb +2 -2
- data/app/views/manifestations/_contributor_fields.html.erb +4 -0
- data/app/views/manifestations/_creator_fields.html.erb +5 -0
- data/app/views/manifestations/_edit_detail.html.erb +1 -1
- data/app/views/manifestations/_export_list.html.erb +3 -3
- data/app/views/manifestations/_form.html.erb +25 -30
- data/app/views/manifestations/_holding.html.erb +6 -8
- data/app/views/manifestations/_identifier_fields.html.erb +5 -0
- data/app/views/manifestations/_index_form_contributor.html.erb +2 -2
- data/app/views/manifestations/_index_form_creator.html.erb +2 -2
- data/app/views/manifestations/_index_form_item.html.erb +2 -2
- data/app/views/manifestations/_index_form_manifestation.html.erb +2 -2
- data/app/views/manifestations/_index_form_parent.html.erb +1 -1
- data/app/views/manifestations/_index_form_publisher.html.erb +2 -2
- data/app/views/manifestations/_index_form_series_statement.html.erb +2 -2
- data/app/views/manifestations/_language_facet.html.erb +1 -1
- data/app/views/manifestations/_library_facet.html.erb +1 -1
- data/app/views/manifestations/_manifestation.html.erb +6 -2
- data/app/views/manifestations/_manifestation.txt.erb +1 -1
- data/app/views/manifestations/_paginate_id_store.html.erb +8 -6
- data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
- data/app/views/manifestations/_publisher_fields.html.erb +4 -0
- data/app/views/manifestations/_reservable_facet.html.erb +2 -2
- data/app/views/manifestations/_series_statement_fields.html.erb +13 -0
- data/app/views/manifestations/_show.rdf.builder +3 -87
- data/app/views/manifestations/{_show_creators.mobile.erb → _show_creators.html+phone.erb} +0 -0
- data/app/views/manifestations/_show_creators.html.erb +0 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +20 -22
- data/app/views/manifestations/_show_detail_user.html.erb +13 -15
- data/app/views/manifestations/{_show_holding.mobile.erb → _show_holding.html+phone.erb} +0 -0
- data/app/views/manifestations/_show_holding.html.erb +1 -1
- data/app/views/manifestations/{_show_index.mobile.erb → _show_index.html+phone.erb} +0 -0
- data/app/views/manifestations/_submenu_parent.html.erb +3 -3
- data/app/views/manifestations/{_title.mobile.erb → _title.html+phone.erb} +0 -0
- data/app/views/manifestations/edit.html.erb +2 -6
- data/app/views/manifestations/{index.mobile.erb → index.html+phone.erb} +0 -0
- data/app/views/manifestations/index.html.erb +40 -24
- data/app/views/manifestations/index.rdf.builder +5 -3
- data/app/views/manifestations/index.rss.builder +2 -2
- data/app/views/manifestations/index.txt.erb +1 -2
- data/app/views/manifestations/{show.mobile.erb → show.html+phone.erb} +1 -1
- data/app/views/manifestations/show.html.erb +1 -1
- data/app/views/manifestations/show.txt.erb +1 -2
- data/app/views/medium_of_performances/index.html.erb +4 -4
- data/app/views/owns/index.html.erb +2 -2
- data/app/views/picture_files/_index.html.erb +3 -3
- data/app/views/picture_files/_index_agent.html.erb +4 -4
- data/app/views/picture_files/_index_manifestation.html.erb +4 -4
- data/app/views/picture_files/{_link.mobile.erb → _link.html+phone.erb} +0 -0
- data/app/views/picture_files/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/produce_types/index.html.erb +4 -4
- data/app/views/produces/_index.html.erb +2 -2
- data/app/views/produces/_index_agent.html.erb +2 -2
- data/app/views/produces/_index_manifestation.html.erb +2 -2
- data/app/views/realize_types/index.html.erb +4 -4
- data/app/views/realizes/_index.html.erb +2 -2
- data/app/views/realizes/_index_agent.html.erb +2 -2
- data/app/views/realizes/_index_expression.html.erb +2 -2
- data/app/views/series_statement_merges/show.html.erb +0 -2
- data/app/views/series_statements/_index.html.erb +4 -4
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +2 -2
- data/app/views/series_statements/show.html.erb +1 -1
- data/config/locales/translation_en.yml +13 -0
- data/config/locales/translation_ja.yml +13 -0
- data/config/routes.rb +3 -43
- data/lib/enju_biblio/engine.rb +0 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +0 -107
- data/lib/tasks/enju_biblio_tasks.rake +1 -1
- data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +43 -43
- 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 +45 -45
- 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 +50 -50
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +44 -44
- 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 +48 -48
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +41 -41
- data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +50 -50
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +49 -49
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +45 -45
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +50 -50
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +48 -48
- 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 +512 -0
- 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 +42 -42
- data/spec/controllers/agent_import_files_controller_spec.rb +5 -5
- data/spec/controllers/agent_import_results_controller_spec.rb +3 -3
- data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/agent_merges_controller_spec.rb +9 -9
- data/spec/controllers/agent_relationship_types_controller_spec.rb +14 -14
- data/spec/controllers/agent_relationships_controller_spec.rb +9 -9
- data/spec/controllers/agent_types_controller_spec.rb +2 -2
- data/spec/controllers/agents_controller_spec.rb +8 -8
- data/spec/controllers/carrier_types_controller_spec.rb +1 -1
- data/spec/controllers/content_types_controller_spec.rb +1 -1
- data/spec/controllers/countries_controller_spec.rb +10 -10
- data/spec/controllers/create_types_controller_spec.rb +2 -2
- data/spec/controllers/creates_controller_spec.rb +7 -7
- data/spec/controllers/donates_controller_spec.rb +9 -9
- data/spec/controllers/form_of_works_controller_spec.rb +2 -2
- data/spec/controllers/frequencies_controller_spec.rb +2 -2
- data/spec/controllers/identifier_types_controller_spec.rb +2 -2
- data/spec/controllers/import_requests_controller_spec.rb +9 -9
- data/spec/controllers/items_controller_spec.rb +13 -7
- data/spec/controllers/languages_controller_spec.rb +8 -8
- data/spec/controllers/licenses_controller_spec.rb +2 -2
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +10 -10
- data/spec/controllers/manifestation_relationships_controller_spec.rb +9 -9
- data/spec/controllers/manifestations_controller_spec.rb +86 -12
- data/spec/controllers/medium_of_performances_controller_spec.rb +2 -2
- data/spec/controllers/owns_controller_spec.rb +7 -7
- data/spec/controllers/picture_files_controller_spec.rb +9 -9
- data/spec/controllers/produce_types_controller_spec.rb +2 -2
- data/spec/controllers/produces_controller_spec.rb +7 -7
- data/spec/controllers/realize_types_controller_spec.rb +2 -2
- data/spec/controllers/realizes_controller_spec.rb +7 -7
- data/spec/controllers/resource_export_files_controller_spec.rb +9 -15
- data/spec/controllers/resource_import_files_controller_spec.rb +7 -7
- data/spec/controllers/resource_import_results_controller_spec.rb +3 -3
- data/spec/controllers/series_statement_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/series_statement_merges_controller_spec.rb +9 -9
- data/spec/controllers/series_statements_controller_spec.rb +7 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +10 -6
- data/spec/dummy/app/models/user.rb +4 -4
- data/spec/dummy/config/application.rb +13 -41
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config/initializers/enju_leaf.rb +8 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +27 -2
- data/spec/factories/classification_type.rb +5 -0
- data/spec/factories/reserve.rb +12 -0
- data/spec/factories/role.rb +9 -0
- data/spec/factories/subject.rb +7 -0
- data/spec/factories/subject_heading_type.rb +5 -0
- data/spec/factories/subject_heading_type_has_subject.rb +6 -0
- data/spec/factories/subject_type.rb +5 -0
- data/spec/fixtures/checked_items.yml +4 -4
- data/spec/fixtures/checkouts.yml +12 -12
- data/spec/fixtures/classification_types.yml +1 -1
- data/spec/fixtures/classifications.yml +1 -0
- data/spec/fixtures/manifestations.yml +4 -4
- data/spec/fixtures/reserves.yml +16 -16
- data/spec/fixtures/subjects.yml +79 -0
- data/spec/models/agent_import_file_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +27 -13
- data/spec/models/resource_export_file_spec.rb +15 -2
- data/spec/models/resource_import_file_spec.rb +29 -9
- data/spec/models/series_statement_merge_list_spec.rb +1 -1
- data/spec/policies/manifestation_policy_spec.rb +24 -0
- data/spec/rails_helper.rb +82 -0
- data/spec/spec_helper.rb +81 -56
- data/spec/support/devise.rb +2 -2
- data/spec/support/vcr.rb +8 -0
- data/spec/views/agent_types/index.html.erb_spec.rb +2 -1
- data/spec/views/agent_types/show.html.erb_spec.rb +1 -0
- data/spec/views/create_types/index.html.erb_spec.rb +2 -1
- data/spec/views/creates/edit.html.erb_spec.rb +0 -3
- data/spec/views/creates/index.html.erb_spec.rb +2 -4
- data/spec/views/creates/new.html.erb_spec.rb +0 -3
- data/spec/views/creates/show.html.erb_spec.rb +0 -3
- data/spec/views/import_requests/index.html.erb_spec.rb +3 -2
- data/spec/views/manifestations/index.html.erb_spec.rb +25 -0
- data/spec/views/manifestations/index.rdf.builder_spec.rb +23 -0
- data/spec/views/manifestations/index.txt.erb_spec.rb +17 -0
- data/spec/views/manifestations/show.html.erb_spec.rb +2 -3
- data/spec/views/manifestations/show.txt.erb_spec.rb +16 -0
- data/spec/views/owns/edit.html.erb_spec.rb +0 -3
- data/spec/views/owns/index.html.erb_spec.rb +2 -4
- data/spec/views/owns/new.html.erb_spec.rb +0 -3
- data/spec/views/owns/show.html.erb_spec.rb +0 -3
- data/spec/views/produce_types/index.html.erb_spec.rb +2 -1
- data/spec/views/produces/edit.html.erb_spec.rb +0 -3
- data/spec/views/produces/index.html.erb_spec.rb +2 -4
- data/spec/views/produces/new.html.erb_spec.rb +0 -3
- data/spec/views/produces/show.html.erb_spec.rb +0 -3
- data/spec/views/realize_types/index.html.erb_spec.rb +2 -1
- data/spec/views/realizes/edit.html.erb_spec.rb +0 -3
- data/spec/views/realizes/index.html.erb_spec.rb +2 -4
- data/spec/views/realizes/new.html.erb_spec.rb +0 -3
- data/spec/views/realizes/show.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_files/index.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_files/{show.html.erb_spec.erb → show.html.erb_spec.rb} +0 -3
- data/spec/views/resource_import_results/index.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_results/{show.html.erb_spec.erb → show.html.erb_spec.rb} +1 -4
- data/spec/views/series_statement_merge_lists/index.html.erb_spec.rb +1 -1
- data/spec/views/series_statement_merges/edit.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/index.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/new.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/show.html.erb_spec.rb +0 -3
- metadata +170 -131
- data/app/models/enju_biblio/ability.rb +0 -238
- data/app/workers/agent_import_file_queue.rb +0 -7
- data/app/workers/resource_export_file_queue.rb +0 -7
- data/app/workers/resource_import_file_queue.rb +0 -7
- data/spec/dummy/config/application.yml +0 -42
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: 20151213072705) do
|
15
15
|
|
16
16
|
create_table "accepts", force: :cascade do |t|
|
17
17
|
t.integer "basket_id"
|
@@ -158,12 +158,14 @@ ActiveRecord::Schema.define(version: 20150221063719) do
|
|
158
158
|
t.string "birth_date"
|
159
159
|
t.string "death_date"
|
160
160
|
t.string "agent_identifier"
|
161
|
+
t.integer "profile_id"
|
161
162
|
end
|
162
163
|
|
163
164
|
add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
|
164
165
|
add_index "agents", ["country_id"], name: "index_agents_on_country_id"
|
165
166
|
add_index "agents", ["full_name"], name: "index_agents_on_full_name"
|
166
167
|
add_index "agents", ["language_id"], name: "index_agents_on_language_id"
|
168
|
+
add_index "agents", ["profile_id"], name: "index_agents_on_profile_id"
|
167
169
|
add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
|
168
170
|
|
169
171
|
create_table "baskets", force: :cascade do |t|
|
@@ -739,6 +741,18 @@ ActiveRecord::Schema.define(version: 20150221063719) do
|
|
739
741
|
add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
|
740
742
|
add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
|
741
743
|
|
744
|
+
create_table "library_group_translations", force: :cascade do |t|
|
745
|
+
t.integer "library_group_id", null: false
|
746
|
+
t.string "locale", null: false
|
747
|
+
t.datetime "created_at", null: false
|
748
|
+
t.datetime "updated_at", null: false
|
749
|
+
t.text "login_banner"
|
750
|
+
t.text "footer_banner"
|
751
|
+
end
|
752
|
+
|
753
|
+
add_index "library_group_translations", ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
|
754
|
+
add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
|
755
|
+
|
742
756
|
create_table "library_groups", force: :cascade do |t|
|
743
757
|
t.string "name", null: false
|
744
758
|
t.text "display_name"
|
@@ -941,7 +955,7 @@ ActiveRecord::Schema.define(version: 20150221063719) do
|
|
941
955
|
t.text "title", null: false
|
942
956
|
t.text "body", null: false
|
943
957
|
t.integer "position"
|
944
|
-
t.string "locale", default: "
|
958
|
+
t.string "locale", default: "en"
|
945
959
|
t.datetime "created_at"
|
946
960
|
t.datetime "updated_at"
|
947
961
|
end
|
@@ -1609,4 +1623,15 @@ ActiveRecord::Schema.define(version: 20150221063719) do
|
|
1609
1623
|
|
1610
1624
|
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
1611
1625
|
|
1626
|
+
create_table "withdraws", force: :cascade do |t|
|
1627
|
+
t.integer "basket_id"
|
1628
|
+
t.integer "item_id"
|
1629
|
+
t.integer "librarian_id"
|
1630
|
+
t.datetime "created_at", null: false
|
1631
|
+
t.datetime "updated_at", null: false
|
1632
|
+
end
|
1633
|
+
|
1634
|
+
add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
|
1635
|
+
add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
|
1636
|
+
|
1612
1637
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :reserve do |f|
|
3
|
+
before(:create) do |reserve|
|
4
|
+
profile = FactoryGirl.create(:profile)
|
5
|
+
user = FactoryGirl.create(:admin)
|
6
|
+
user.profile = profile
|
7
|
+
reserve.user = user
|
8
|
+
end
|
9
|
+
f.manifestation_id{FactoryGirl.create(:manifestation).id}
|
10
|
+
# f.user{FactoryGirl.create(:user)}
|
11
|
+
end
|
12
|
+
end
|
@@ -3,22 +3,22 @@ checked_item_00001:
|
|
3
3
|
id: 1
|
4
4
|
item_id: 10
|
5
5
|
basket_id: 1
|
6
|
-
due_date: <%= 1.week.from_now %>
|
6
|
+
due_date: <%= 1.week.from_now.to_s(:db) %>
|
7
7
|
checked_item_00002:
|
8
8
|
id: 2
|
9
9
|
item_id: 6
|
10
10
|
basket_id: 2
|
11
|
-
due_date: <%= 1.week.from_now %>
|
11
|
+
due_date: <%= 1.week.from_now.to_s(:db) %>
|
12
12
|
checked_item_00003:
|
13
13
|
id: 3
|
14
14
|
item_id: 6
|
15
15
|
basket_id: 9
|
16
|
-
due_date: <%= 1.week.from_now %>
|
16
|
+
due_date: <%= 1.week.from_now.to_s(:db) %>
|
17
17
|
checked_item_00004:
|
18
18
|
id: 4
|
19
19
|
item_id: 12
|
20
20
|
basket_id: 8
|
21
|
-
due_date: <%= 1.week.from_now %>
|
21
|
+
due_date: <%= 1.week.from_now.to_s(:db) %>
|
22
22
|
|
23
23
|
# == Schema Information
|
24
24
|
#
|
data/spec/fixtures/checkouts.yml
CHANGED
@@ -7,7 +7,7 @@ checkout_00001:
|
|
7
7
|
id: 1
|
8
8
|
librarian_id: 1
|
9
9
|
checkout_renewal_count: 0
|
10
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
10
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
11
11
|
created_at: 2007-09-08 01:19:02.285850 +09:00
|
12
12
|
basket_id: 1
|
13
13
|
checkout_00002:
|
@@ -18,7 +18,7 @@ checkout_00002:
|
|
18
18
|
id: 2
|
19
19
|
librarian_id: 1
|
20
20
|
checkout_renewal_count: 0
|
21
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
21
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
22
22
|
created_at: 2007-09-08 01:34:07.363023 +09:00
|
23
23
|
basket_id: 1
|
24
24
|
checkout_00003:
|
@@ -29,7 +29,7 @@ checkout_00003:
|
|
29
29
|
id: 3
|
30
30
|
librarian_id: 1
|
31
31
|
checkout_renewal_count: 0
|
32
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
32
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
33
33
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
34
34
|
basket_id: 2
|
35
35
|
checkout_00004:
|
@@ -40,7 +40,7 @@ checkout_00004:
|
|
40
40
|
id: 4
|
41
41
|
librarian_id: 1
|
42
42
|
checkout_renewal_count: 0
|
43
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
43
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
44
44
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
45
45
|
basket_id: 3
|
46
46
|
checkout_00005:
|
@@ -51,7 +51,7 @@ checkout_00005:
|
|
51
51
|
id: 5
|
52
52
|
librarian_id: 1
|
53
53
|
checkout_renewal_count: 0
|
54
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
54
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
55
55
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
56
56
|
basket_id: 4
|
57
57
|
checkout_00006:
|
@@ -72,7 +72,7 @@ checkout_00007:
|
|
72
72
|
id: 7
|
73
73
|
librarian_id: 1
|
74
74
|
checkout_renewal_count: 0
|
75
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
75
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
76
76
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
77
77
|
basket_id: 5
|
78
78
|
checkout_00008:
|
@@ -83,7 +83,7 @@ checkout_00008:
|
|
83
83
|
id: 8
|
84
84
|
librarian_id: 1
|
85
85
|
checkout_renewal_count: 0
|
86
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
86
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
87
87
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
88
88
|
basket_id: 6
|
89
89
|
checkout_00009:
|
@@ -94,7 +94,7 @@ checkout_00009:
|
|
94
94
|
id: 9
|
95
95
|
librarian_id: 1
|
96
96
|
checkout_renewal_count: 1
|
97
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
97
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
98
98
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
99
99
|
basket_id: 7
|
100
100
|
checkout_00010:
|
@@ -105,7 +105,7 @@ checkout_00010:
|
|
105
105
|
id: 10
|
106
106
|
librarian_id: 1
|
107
107
|
checkout_renewal_count: 1
|
108
|
-
due_date: <%= 2.day.from_now.beginning_of_day %>
|
108
|
+
due_date: <%= 2.day.from_now.beginning_of_day.to_s(:db) %>
|
109
109
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
110
110
|
basket_id: 7
|
111
111
|
checkout_00011:
|
@@ -116,7 +116,7 @@ checkout_00011:
|
|
116
116
|
id: 11
|
117
117
|
librarian_id: 1
|
118
118
|
checkout_renewal_count: 1
|
119
|
-
due_date: <%= 180.days.ago.beginning_of_day %>
|
119
|
+
due_date: <%= 180.days.ago.beginning_of_day.to_s(:db) %>
|
120
120
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
121
121
|
basket_id: 7
|
122
122
|
checkout_00012:
|
@@ -127,7 +127,7 @@ checkout_00012:
|
|
127
127
|
id: 12
|
128
128
|
librarian_id: 1
|
129
129
|
checkout_renewal_count: 1
|
130
|
-
due_date: <%= 180.days.ago.beginning_of_day %>
|
130
|
+
due_date: <%= 180.days.ago.beginning_of_day.to_s(:db) %>
|
131
131
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
132
132
|
basket_id: 8
|
133
133
|
checkin_id: 5
|
@@ -139,7 +139,7 @@ checkout_00013:
|
|
139
139
|
id: 13
|
140
140
|
librarian_id: 1
|
141
141
|
checkout_renewal_count: 1
|
142
|
-
due_date: <%= 180.days.ago.beginning_of_day %>
|
142
|
+
due_date: <%= 180.days.ago.beginning_of_day.to_s(:db) %>
|
143
143
|
created_at: 2007-09-08 01:39:03.210081 +09:00
|
144
144
|
basket_id: 8
|
145
145
|
checkin_id: 4
|
@@ -3,9 +3,9 @@ manifestation_00001:
|
|
3
3
|
carrier_type_id: 1
|
4
4
|
language_id: 1
|
5
5
|
updated_at: 2007-11-19 16:59:00.293393 +09:00
|
6
|
-
original_title: "
|
6
|
+
original_title: "よくわかる最新Webサービス技術の基本と仕組み : 標準Webシステム技術とeコマース基盤技術入門"
|
7
7
|
price:
|
8
|
-
manifestation_identifier:
|
8
|
+
manifestation_identifier: 00001
|
9
9
|
depth:
|
10
10
|
date_of_publication:
|
11
11
|
access_address:
|
@@ -20,7 +20,7 @@ manifestation_00002:
|
|
20
20
|
carrier_type_id: 1
|
21
21
|
language_id: 1
|
22
22
|
updated_at: 2007-11-19 16:59:01.991512 +09:00
|
23
|
-
original_title: "
|
23
|
+
original_title: "情報通信ハンドブック : 情報通信の最新データがわかる 2005年版"
|
24
24
|
price:
|
25
25
|
manifestation_identifier:
|
26
26
|
depth:
|
@@ -112,7 +112,7 @@ manifestation_00008:
|
|
112
112
|
carrier_type_id: 1
|
113
113
|
language_id: 1
|
114
114
|
updated_at: 2007-11-19 16:59:07.463333 +09:00
|
115
|
-
original_title: "Web
|
115
|
+
original_title: "Webサービス完全解説 : 基礎からわかる次世代インターネット・テクノロジー"
|
116
116
|
price:
|
117
117
|
manifestation_identifier:
|
118
118
|
depth:
|
data/spec/fixtures/reserves.yml
CHANGED
@@ -6,7 +6,7 @@ reserve_00003:
|
|
6
6
|
request_status_type_id: 4
|
7
7
|
id: 3
|
8
8
|
created_at: 2007-09-02 17:46:52.791614 +09:00
|
9
|
-
expired_at: <%= 1.week.from_now %>
|
9
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
10
10
|
reserve_00004:
|
11
11
|
updated_at: 2007-09-02 18:37:25.576087 +09:00
|
12
12
|
manifestation_id: 7
|
@@ -14,7 +14,7 @@ reserve_00004:
|
|
14
14
|
request_status_type_id: 4
|
15
15
|
id: 4
|
16
16
|
created_at: 2007-09-02 18:37:25.576087 +09:00
|
17
|
-
expired_at: <%= 1.week.from_now %>
|
17
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
18
18
|
reserve_00005:
|
19
19
|
updated_at: 2007-09-02 19:16:55.714812 +09:00
|
20
20
|
manifestation_id: 8
|
@@ -22,7 +22,7 @@ reserve_00005:
|
|
22
22
|
request_status_type_id: 4
|
23
23
|
id: 5
|
24
24
|
created_at: 2007-09-02 19:16:55.714812 +09:00
|
25
|
-
expired_at: <%= 1.week.from_now %>
|
25
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
26
26
|
reserve_00001:
|
27
27
|
updated_at: 2007-09-02 17:51:54.887849 +09:00
|
28
28
|
manifestation_id: 4
|
@@ -30,7 +30,7 @@ reserve_00001:
|
|
30
30
|
request_status_type_id: 4
|
31
31
|
id: 1
|
32
32
|
created_at: 2007-09-01 14:14:52.356803 +09:00
|
33
|
-
expired_at: <%= 1.week.from_now %>
|
33
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
34
34
|
reserve_00002:
|
35
35
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
36
36
|
manifestation_id: 5
|
@@ -38,7 +38,7 @@ reserve_00002:
|
|
38
38
|
request_status_type_id: 4
|
39
39
|
id: 2
|
40
40
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
41
|
-
expired_at: <%= 1.week.from_now %>
|
41
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
42
42
|
reserve_00006:
|
43
43
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
44
44
|
manifestation_id: 4
|
@@ -46,7 +46,7 @@ reserve_00006:
|
|
46
46
|
request_status_type_id: 4
|
47
47
|
id: 6
|
48
48
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
49
|
-
expired_at: <%= 1.week.from_now %>
|
49
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
50
50
|
reserve_00007:
|
51
51
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
52
52
|
manifestation_id: 2
|
@@ -54,7 +54,7 @@ reserve_00007:
|
|
54
54
|
request_status_type_id: 4
|
55
55
|
id: 7
|
56
56
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
57
|
-
expired_at: <%= 1.week.from_now %>
|
57
|
+
expired_at: <%= 1.week.from_now.to_s(:db) %>
|
58
58
|
reserve_00008:
|
59
59
|
updated_at: 2007-09-02 17:46:52.791614 +09:00
|
60
60
|
manifestation_id: 6
|
@@ -62,7 +62,7 @@ reserve_00008:
|
|
62
62
|
request_status_type_id: 3
|
63
63
|
id: 8
|
64
64
|
created_at: 2007-09-02 17:46:52.791614 +09:00
|
65
|
-
expired_at: <%= 1.week.ago %>
|
65
|
+
expired_at: <%= 1.week.ago.to_s(:db) %>
|
66
66
|
reserve_00009:
|
67
67
|
updated_at: 2007-09-02 17:46:52.791614 +09:00
|
68
68
|
manifestation_id: 7
|
@@ -70,7 +70,7 @@ reserve_00009:
|
|
70
70
|
request_status_type_id: 3
|
71
71
|
id: 9
|
72
72
|
created_at: 2007-09-02 17:46:52.791614 +09:00
|
73
|
-
expired_at: <%= 1.day.ago %>
|
73
|
+
expired_at: <%= 1.day.ago.to_s(:db) %>
|
74
74
|
reserve_00010:
|
75
75
|
updated_at: 2007-09-02 17:46:52.791614 +09:00
|
76
76
|
manifestation_id: 8
|
@@ -78,8 +78,8 @@ reserve_00010:
|
|
78
78
|
request_status_type_id: 3
|
79
79
|
id: 10
|
80
80
|
created_at: 2007-09-02 17:46:52.791614 +09:00
|
81
|
-
expired_at: <%= 1.hour.ago %>
|
82
|
-
checked_out_at: <%= 1.week.ago %>
|
81
|
+
expired_at: <%= 1.hour.ago.to_s(:db) %>
|
82
|
+
checked_out_at: <%= 1.week.ago.to_s(:db) %>
|
83
83
|
reserve_00011:
|
84
84
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
85
85
|
manifestation_id: 7
|
@@ -87,7 +87,7 @@ reserve_00011:
|
|
87
87
|
request_status_type_id: 3
|
88
88
|
id: 11
|
89
89
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
90
|
-
expired_at: <%= 1.day.ago %>
|
90
|
+
expired_at: <%= 1.day.ago.to_s(:db) %>
|
91
91
|
reserve_00012:
|
92
92
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
93
93
|
manifestation_id: 8
|
@@ -95,7 +95,7 @@ reserve_00012:
|
|
95
95
|
request_status_type_id: 4
|
96
96
|
id: 12
|
97
97
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
98
|
-
expired_at: <%= 1.day.ago %>
|
98
|
+
expired_at: <%= 1.day.ago.to_s(:db) %>
|
99
99
|
reserve_00013:
|
100
100
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
101
101
|
manifestation_id: 11
|
@@ -103,7 +103,7 @@ reserve_00013:
|
|
103
103
|
request_status_type_id: 3
|
104
104
|
id: 13
|
105
105
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
106
|
-
expired_at: <%= 1.day.ago %>
|
106
|
+
expired_at: <%= 1.day.ago.to_s(:db) %>
|
107
107
|
reserve_00014:
|
108
108
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
109
109
|
manifestation_id: 11
|
@@ -111,7 +111,7 @@ reserve_00014:
|
|
111
111
|
request_status_type_id: 3
|
112
112
|
id: 14
|
113
113
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
114
|
-
expired_at: <%= 1.day.from_now %>
|
114
|
+
expired_at: <%= 1.day.from_now.to_s(:db) %>
|
115
115
|
item_id: 21
|
116
116
|
reserve_00015:
|
117
117
|
updated_at: 2007-09-01 14:20:05.530854 +09:00
|
@@ -120,7 +120,7 @@ reserve_00015:
|
|
120
120
|
request_status_type_id: 3
|
121
121
|
id: 15
|
122
122
|
created_at: 2007-09-01 14:20:05.530854 +09:00
|
123
|
-
expired_at: <%= 1.day.from_now %>
|
123
|
+
expired_at: <%= 1.day.from_now.to_s(:db) %>
|
124
124
|
|
125
125
|
# == Schema Information
|
126
126
|
#
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
subject_00001:
|
3
|
+
updated_at: 2008-03-02 03:19:58.534251 +09:00
|
4
|
+
term: next-l
|
5
|
+
scope_note:
|
6
|
+
subject_type_id: 1
|
7
|
+
term_transcription: next-l
|
8
|
+
id: 1
|
9
|
+
note:
|
10
|
+
parent_id:
|
11
|
+
created_at: 2008-03-01 17:53:06.118389 +09:00
|
12
|
+
manifestation_id: 1
|
13
|
+
subject_heading_type_id: 1
|
14
|
+
subject_00002:
|
15
|
+
updated_at: 2008-03-02 03:19:57.946759 +09:00
|
16
|
+
term: test2
|
17
|
+
scope_note:
|
18
|
+
subject_type_id: 1
|
19
|
+
term_transcription: test2
|
20
|
+
id: 2
|
21
|
+
note:
|
22
|
+
parent_id:
|
23
|
+
created_at: 2008-03-01 17:50:34.658349 +09:00
|
24
|
+
subject_heading_type_id: 1
|
25
|
+
subject_00003:
|
26
|
+
updated_at: 2008-03-02 03:19:58.048475 +09:00
|
27
|
+
term: test3
|
28
|
+
scope_note:
|
29
|
+
subject_type_id: 1
|
30
|
+
term_transcription: test3
|
31
|
+
id: 3
|
32
|
+
note:
|
33
|
+
parent_id:
|
34
|
+
created_at: 2008-03-01 17:51:39.448430 +09:00
|
35
|
+
subject_heading_type_id: 2
|
36
|
+
subject_00004:
|
37
|
+
updated_at: 2008-03-02 03:19:58.048475 +09:00
|
38
|
+
term: test4
|
39
|
+
scope_note:
|
40
|
+
subject_type_id: 1
|
41
|
+
term_transcription: test4
|
42
|
+
id: 4
|
43
|
+
note:
|
44
|
+
parent_id:
|
45
|
+
created_at: 2008-03-01 17:51:39.448430 +09:00
|
46
|
+
subject_heading_type_id: 2
|
47
|
+
subject_00005:
|
48
|
+
updated_at: 2008-03-02 03:19:58.048475 +09:00
|
49
|
+
term: test5
|
50
|
+
scope_note:
|
51
|
+
subject_type_id: 1
|
52
|
+
term_transcription: test5
|
53
|
+
id: 5
|
54
|
+
note:
|
55
|
+
parent_id:
|
56
|
+
created_at: 2008-03-01 17:51:39.448430 +09:00
|
57
|
+
subject_heading_type_id: 2
|
58
|
+
|
59
|
+
# == Schema Information
|
60
|
+
#
|
61
|
+
# Table name: subjects
|
62
|
+
#
|
63
|
+
# id :integer not null, primary key
|
64
|
+
# parent_id :integer
|
65
|
+
# use_term_id :integer
|
66
|
+
# term :string
|
67
|
+
# term_transcription :text
|
68
|
+
# subject_type_id :integer not null
|
69
|
+
# scope_note :text
|
70
|
+
# note :text
|
71
|
+
# required_role_id :integer default(1), not null
|
72
|
+
# lock_version :integer default(0), not null
|
73
|
+
# created_at :datetime
|
74
|
+
# updated_at :datetime
|
75
|
+
# deleted_at :datetime
|
76
|
+
# url :string
|
77
|
+
# manifestation_id :integer
|
78
|
+
# subject_heading_type_id :integer
|
79
|
+
#
|
@@ -72,7 +72,7 @@ describe AgentImportFile do
|
|
72
72
|
file = AgentImportFile.create :agent_import => File.new("#{Rails.root.to_s}/../../examples/agent_import_file_sample1.tsv")
|
73
73
|
file.user = users(:admin)
|
74
74
|
file.save
|
75
|
-
|
75
|
+
AgentImportFileJob.perform_later(file).should be_truthy
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
require '
|
2
|
+
require 'rails_helper'
|
3
3
|
|
4
4
|
describe Manifestation, :solr => true do
|
5
5
|
fixtures :all
|
@@ -84,7 +84,7 @@ describe Manifestation, :solr => true do
|
|
84
84
|
results.size.should eq 9
|
85
85
|
end
|
86
86
|
|
87
|
-
it "should
|
87
|
+
it "should search multi in openurl" do
|
88
88
|
openurl = Openurl.new({:btitle => "CGI Perl プログラミング"})
|
89
89
|
results = openurl.search
|
90
90
|
results.size.should eq 2
|
@@ -226,17 +226,31 @@ describe Manifestation, :solr => true do
|
|
226
226
|
context ".export" do
|
227
227
|
it "should export a header line" do
|
228
228
|
lines = Manifestation.export
|
229
|
-
CSV.parse(lines, col_sep: "\t")
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
229
|
+
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
230
|
+
csv["manifestation_id"].compact.should_not be_empty
|
231
|
+
csv["manifestation_identifier"].compact.should_not be_empty
|
232
|
+
csv["manifestation_created_at"].compact.should_not be_empty
|
233
|
+
csv["manifestation_updated_at"].compact.should_not be_empty
|
234
|
+
csv["item_id"].compact.should_not be_empty
|
235
|
+
csv["item_created_at"].compact.should_not be_empty
|
236
|
+
csv["item_updated_at"].compact.should_not be_empty
|
237
|
+
csv["subject:unknown"].compact.should eq manifestations(:manifestation_00001).items.count.times.map{"next-l"}
|
238
|
+
csv["classification:ndc9"].compact.should eq manifestations(:manifestation_00001).items.count.times.map{"400"}
|
239
|
+
end
|
240
|
+
|
241
|
+
it "should respect the role of the user" do
|
242
|
+
FactoryGirl.create(:item, bookstore_id: 1, price: 100, budget_type_id: 1)
|
243
|
+
lines = Manifestation.export
|
244
|
+
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
245
|
+
expect(csv["bookstore"].compact).to be_empty
|
246
|
+
expect(csv["item_price"].compact).to be_empty
|
247
|
+
expect(csv["budget_type"].compact).to be_empty
|
248
|
+
|
249
|
+
lines = Manifestation.export(format: :txt, role: :Librarian)
|
250
|
+
csv = CSV.parse(lines, headers: true, col_sep: "\t")
|
251
|
+
expect(csv["bookstore"].compact).not_to be_empty
|
252
|
+
expect(csv["item_price"].compact).not_to be_empty
|
253
|
+
expect(csv["budget_type"].compact).not_to be_empty
|
240
254
|
end
|
241
255
|
end
|
242
256
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
require '
|
2
|
+
require 'rails_helper'
|
3
3
|
|
4
4
|
describe ResourceExportFile do
|
5
5
|
fixtures :all
|
@@ -9,11 +9,24 @@ describe ResourceExportFile do
|
|
9
9
|
file = ResourceExportFile.new
|
10
10
|
file.user = users(:admin)
|
11
11
|
file.save
|
12
|
-
|
12
|
+
ResourceExportFileJob.perform_later(file).should be_truthy
|
13
13
|
Message.count.should eq message_count + 1
|
14
14
|
Message.order(:id).last.subject.should eq 'エクスポートが完了しました'
|
15
15
|
end
|
16
16
|
|
17
|
+
it "should respect the role of the user" do
|
18
|
+
export_file = ResourceExportFile.new
|
19
|
+
export_file.user = users(:admin)
|
20
|
+
export_file.save!
|
21
|
+
export_file.export!
|
22
|
+
file = export_file.resource_export
|
23
|
+
lines = File.open(file.path).readlines.map(&:chomp)
|
24
|
+
columns = lines.first.split(/\t/)
|
25
|
+
expect(columns).to include "bookstore"
|
26
|
+
expect(columns).to include "budget_type"
|
27
|
+
expect(columns).to include "item_price"
|
28
|
+
end
|
29
|
+
|
17
30
|
context "NCID export" do
|
18
31
|
it "should export NCID value" do
|
19
32
|
manifestation = FactoryGirl.create(:manifestation)
|