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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f22c619e2e023ba90b4d76131e0c4f42a740bb76
|
4
|
+
data.tar.gz: 1b27cdc13c2cd26379b8db84fde261ffdc6757cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3bba80e90836041a24d98b327bb5208d61ea6fdcf81e364263cbe885e809064b56dd9b4849498f38fdaa15b429e322c92cf14abd6f1be7924213506f79d0fd7
|
7
|
+
data.tar.gz: 4bb20c415894012ba00e271d6db98b251d9465a6a66fe1b1d7b8b685aedbf79d941277c55b13bd19835e24cebf0eec1acb8e64a1e28300c586b0d661880680d7
|
data/README.rdoc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= EnjuBiblio
|
2
|
-
{<img src="https://
|
3
|
-
{<img src="https://coveralls.io/repos/next-l/enju_biblio/badge.
|
4
|
-
{<img src="https://hakiri.io/github/next-l/enju_biblio/1.
|
2
|
+
{<img src="https://travis-ci.org/next-l/enju_biblio.svg?branch=1.2" alt="Build Status" />}[https://travis-ci.org/next-l/enju_biblio]
|
3
|
+
{<img src="https://coveralls.io/repos/next-l/enju_biblio/badge.svg?branch=1.2&service=github" alt="Coverage Status" />}[https://coveralls.io/github/next-l/enju_biblio?branch=1.2]
|
4
|
+
{<img src="https://hakiri.io/github/next-l/enju_biblio/1.2.svg" alt="security" />}[https://hakiri.io/github/next-l/enju_biblio/1.2]
|
5
5
|
|
6
6
|
This project rocks and uses MIT-LICENSE.
|
7
7
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class AgentImportFilesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_agent_import_file, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
3
4
|
|
4
5
|
# GET /agent_import_files
|
5
6
|
# GET /agent_import_files.json
|
@@ -58,7 +59,7 @@ class AgentImportFilesController < ApplicationController
|
|
58
59
|
respond_to do |format|
|
59
60
|
if @agent_import_file.save
|
60
61
|
if @agent_import_file.mode == 'import'
|
61
|
-
|
62
|
+
AgentImportFileJob.perform_later(@agent_import_file)
|
62
63
|
end
|
63
64
|
format.html { redirect_to @agent_import_file, notice: t('controller.successfully_created', model: t('activerecord.models.agent_import_file')) }
|
64
65
|
format.json { render json: @agent_import_file, status: :created, location: @agent_import_file }
|
@@ -75,7 +76,7 @@ class AgentImportFilesController < ApplicationController
|
|
75
76
|
respond_to do |format|
|
76
77
|
if @agent_import_file.update_attributes(agent_import_file_params)
|
77
78
|
if @agent_import_file.mode == 'import'
|
78
|
-
|
79
|
+
AgentImportFileJob.perform_later(@agent_import_file)
|
79
80
|
end
|
80
81
|
format.html { redirect_to @agent_import_file, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_import_file')) }
|
81
82
|
format.json { head :no_content }
|
@@ -98,6 +99,15 @@ class AgentImportFilesController < ApplicationController
|
|
98
99
|
end
|
99
100
|
|
100
101
|
private
|
102
|
+
def set_agent_import_file
|
103
|
+
@agent_import_file = AgentImportFile.find(params[:id])
|
104
|
+
authorize @agent_import_file
|
105
|
+
end
|
106
|
+
|
107
|
+
def check_policy
|
108
|
+
authorize AgentImportFile
|
109
|
+
end
|
110
|
+
|
101
111
|
def agent_import_file_params
|
102
112
|
params.require(:agent_import_file).permit(
|
103
113
|
:agent_import, :edit_mode, :user_encoding, :mode
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class AgentImportResultsController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_agent_import_result, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index]
|
4
|
+
|
3
5
|
# GET /agent_import_results
|
4
6
|
# GET /agent_import_results.json
|
5
7
|
def index
|
@@ -38,6 +40,15 @@ class AgentImportResultsController < ApplicationController
|
|
38
40
|
end
|
39
41
|
|
40
42
|
private
|
43
|
+
def set_agent_import_result
|
44
|
+
@agent_import_result = AgentImportResult.find(params[:id])
|
45
|
+
authorize @agent_import_result
|
46
|
+
end
|
47
|
+
|
48
|
+
def check_policy
|
49
|
+
authorize AgentImportResult
|
50
|
+
end
|
51
|
+
|
41
52
|
def agent_import_result_params
|
42
53
|
params.require(:agent_import_result).permit(
|
43
54
|
:agent_import_file_id, :agent_id, :body
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class AgentMergeListsController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_agent_merge_list, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
3
4
|
|
4
5
|
# GET /agent_merge_lists
|
5
6
|
# GET /agent_merge_lists.json
|
@@ -92,6 +93,15 @@ class AgentMergeListsController < ApplicationController
|
|
92
93
|
end
|
93
94
|
|
94
95
|
private
|
96
|
+
def set_agent_merge_list
|
97
|
+
@agent_merge_list = AgentMergeList.find(params[:id])
|
98
|
+
authorize @agent_merge_list
|
99
|
+
end
|
100
|
+
|
101
|
+
def check_policy
|
102
|
+
authorize AgentMergeList
|
103
|
+
end
|
104
|
+
|
95
105
|
def agent_merge_list_params
|
96
106
|
params.fetch(:agent_merge_list, {}).permit(:title)
|
97
107
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class AgentMergesController < ApplicationController
|
2
|
-
|
3
|
-
|
2
|
+
before_action :set_agent_merge, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
before_action :get_agent, :get_agent_merge_list
|
4
5
|
|
5
6
|
# GET /agent_merges
|
6
7
|
# GET /agent_merges.json
|
@@ -86,6 +87,15 @@ class AgentMergesController < ApplicationController
|
|
86
87
|
end
|
87
88
|
|
88
89
|
private
|
90
|
+
def set_agent_merge
|
91
|
+
@agent_merge = AgentMerge.find(params[:id])
|
92
|
+
authorize @agent_merge
|
93
|
+
end
|
94
|
+
|
95
|
+
def check_policy
|
96
|
+
authorize AgentMerge
|
97
|
+
end
|
98
|
+
|
89
99
|
def agent_merge_params
|
90
100
|
params.require(:agent_merge).permit(:agent_id, :agent_merge_list_id)
|
91
101
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class AgentRelationshipTypesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_agent_relationship_type, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /agent_relationship_types
|
4
6
|
# GET /agent_relationship_types.json
|
5
7
|
def index
|
6
|
-
@agent_relationship_types = AgentRelationshipType.
|
8
|
+
@agent_relationship_types = AgentRelationshipType.order(:position)
|
7
9
|
|
8
10
|
respond_to do |format|
|
9
11
|
format.html # index.html.erb
|
@@ -82,6 +84,15 @@ class AgentRelationshipTypesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_agent_relationship_type
|
88
|
+
@agent_relationship_type = AgentRelationshipType.find(params[:id])
|
89
|
+
authorize @agent_relationship_type
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize AgentRelationshipType
|
94
|
+
end
|
95
|
+
|
85
96
|
def agent_relationship_type_params
|
86
97
|
params.require(:agent_relationship_type).permit(:name, :display_name, :note)
|
87
98
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class AgentRelationshipsController < ApplicationController
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
before_action :set_agent_relationship, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
before_action :get_agent
|
5
|
+
before_action :prepare_options, only: [:new, :edit]
|
6
6
|
|
7
7
|
# GET /agent_relationships
|
8
8
|
# GET /agent_relationships.json
|
@@ -102,6 +102,15 @@ class AgentRelationshipsController < ApplicationController
|
|
102
102
|
end
|
103
103
|
|
104
104
|
private
|
105
|
+
def set_agent_relationship
|
106
|
+
@agent_relationship = AgentRelationship.find(params[:id])
|
107
|
+
authorize @agent_relationship
|
108
|
+
end
|
109
|
+
|
110
|
+
def check_policy
|
111
|
+
authorize AgentRelationship
|
112
|
+
end
|
113
|
+
|
105
114
|
def agent_relationship_params
|
106
115
|
params.require(:agent_relationship).permit(
|
107
116
|
:parent_id, :child_id, :agent_relationship_type_id
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class AgentTypesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_agent_type, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /agent_types
|
4
6
|
# GET /agent_types.json
|
5
7
|
def index
|
6
|
-
@agent_types = AgentType.
|
8
|
+
@agent_types = AgentType.order(:position)
|
7
9
|
|
8
10
|
respond_to do |format|
|
9
11
|
format.html # index.html.erb
|
@@ -82,6 +84,15 @@ class AgentTypesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_agent_type
|
88
|
+
@agent_type = AgentType.find(params[:id])
|
89
|
+
authorize @agent_type
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize AgentType
|
94
|
+
end
|
95
|
+
|
85
96
|
def agent_type_params
|
86
97
|
params.require(:agent_type).permit(:name, :display_name, :note)
|
87
98
|
end
|
@@ -1,13 +1,10 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
class AgentsController < ApplicationController
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
before_filter :get_version, only: [:show]
|
10
|
-
after_filter :solr_commit, only: [:create, :update, :destroy]
|
2
|
+
before_action :set_agent, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
before_action :get_work, :get_expression, :get_manifestation, :get_item, :get_agent, except: [:update, :destroy]
|
5
|
+
before_action :get_agent_merge_list, except: [:create, :update, :destroy]
|
6
|
+
before_action :prepare_options, only: [:new, :edit]
|
7
|
+
before_action :get_version, only: [:show]
|
11
8
|
|
12
9
|
# GET /agents
|
13
10
|
# GET /agents.json
|
@@ -82,8 +79,8 @@ class AgentsController < ApplicationController
|
|
82
79
|
format.xml { render xml: @agents }
|
83
80
|
format.rss { render layout: false }
|
84
81
|
format.atom
|
85
|
-
format.json
|
86
|
-
format.
|
82
|
+
format.json
|
83
|
+
format.html.phone
|
87
84
|
end
|
88
85
|
end
|
89
86
|
|
@@ -125,7 +122,7 @@ class AgentsController < ApplicationController
|
|
125
122
|
format.html # show.html.erb
|
126
123
|
format.json { render json: @agent }
|
127
124
|
format.js
|
128
|
-
format.
|
125
|
+
format.html.phone
|
129
126
|
end
|
130
127
|
end
|
131
128
|
|
@@ -201,6 +198,15 @@ class AgentsController < ApplicationController
|
|
201
198
|
end
|
202
199
|
|
203
200
|
private
|
201
|
+
def set_agent
|
202
|
+
@agent = Agent.find(params[:id])
|
203
|
+
authorize @agent
|
204
|
+
end
|
205
|
+
|
206
|
+
def check_policy
|
207
|
+
authorize Agent
|
208
|
+
end
|
209
|
+
|
204
210
|
def agent_params
|
205
211
|
params.require(:agent).permit(
|
206
212
|
:last_name, :middle_name, :first_name,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class CarrierTypesController < ApplicationController
|
2
|
-
|
3
|
-
|
2
|
+
before_action :set_carrier_type, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
before_action :prepare_options, only: [:new, :edit]
|
4
5
|
|
5
6
|
# GET /carrier_types
|
6
7
|
# GET /carrier_types.json
|
@@ -86,6 +87,15 @@ class CarrierTypesController < ApplicationController
|
|
86
87
|
end
|
87
88
|
|
88
89
|
private
|
90
|
+
def set_carrier_type
|
91
|
+
@carrier_type = CarrierType.find(params[:id])
|
92
|
+
authorize @carrier_type
|
93
|
+
end
|
94
|
+
|
95
|
+
def check_policy
|
96
|
+
authorize CarrierType
|
97
|
+
end
|
98
|
+
|
89
99
|
def carrier_type_params
|
90
100
|
params.require(:carrier_type).permit(
|
91
101
|
:name, :display_name, :note, :position,
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module EnjuBiblio
|
2
|
+
module Controller
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
private
|
6
|
+
|
7
|
+
def get_work
|
8
|
+
@work = Manifestation.find(params[:work_id]) if params[:work_id]
|
9
|
+
authorize @work, :show? if @work
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_expression
|
13
|
+
@expression = Manifestation.find(params[:expression_id]) if params[:expression_id]
|
14
|
+
authorize @expression, :show? if @expression
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_manifestation
|
18
|
+
@manifestation = Manifestation.find(params[:manifestation_id]) if params[:manifestation_id]
|
19
|
+
authorize @manifestation, :show? if @manifestation
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_item
|
23
|
+
@item = Item.find(params[:item_id]) if params[:item_id]
|
24
|
+
authorize @item, :show? if @item
|
25
|
+
end
|
26
|
+
|
27
|
+
def get_carrier_type
|
28
|
+
@carrier_type = CarrierType.find(params[:carrier_type_id]) if params[:carrier_type_id]
|
29
|
+
end
|
30
|
+
|
31
|
+
def get_agent
|
32
|
+
@agent = Agent.find(params[:agent_id]) if params[:agent_id]
|
33
|
+
authorize @agent if @agent
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_series_statement
|
37
|
+
@series_statement = SeriesStatement.find(params[:series_statement_id]) if params[:series_statement_id]
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_basket
|
41
|
+
@basket = Basket.find(params[:basket_id]) if params[:basket_id]
|
42
|
+
end
|
43
|
+
|
44
|
+
def get_agent_merge_list
|
45
|
+
@agent_merge_list = AgentMergeList.find(params[:agent_merge_list_id]) if params[:agent_merge_list_id]
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_series_statement_merge_list
|
49
|
+
@series_statement_merge_list = SeriesStatementMergeList.find(params[:series_statement_merge_list_id]) if params[:series_statement_merge_list_id]
|
50
|
+
end
|
51
|
+
|
52
|
+
def make_internal_query(search)
|
53
|
+
# 内部的なクエリ
|
54
|
+
set_role_query(current_user, search)
|
55
|
+
|
56
|
+
unless params[:mode] == "add"
|
57
|
+
expression = @expression
|
58
|
+
agent = @agent
|
59
|
+
manifestation = @manifestation
|
60
|
+
reservable = @reservable
|
61
|
+
carrier_type = params[:carrier_type]
|
62
|
+
library = params[:library]
|
63
|
+
language = params[:language]
|
64
|
+
if defined?(EnjuSubject)
|
65
|
+
subject = params[:subject]
|
66
|
+
subject_by_term = Subject.where(term: params[:subject]).first
|
67
|
+
@subject_by_term = subject_by_term
|
68
|
+
end
|
69
|
+
|
70
|
+
search.build do
|
71
|
+
with(:publisher_ids).equal_to agent.id if agent
|
72
|
+
with(:original_manifestation_ids).equal_to manifestation.id if manifestation
|
73
|
+
with(:reservable).equal_to reservable unless reservable.nil?
|
74
|
+
unless carrier_type.blank?
|
75
|
+
with(:carrier_type).equal_to carrier_type
|
76
|
+
end
|
77
|
+
unless library.blank?
|
78
|
+
library_list = library.split.uniq
|
79
|
+
library_list.each do |lib|
|
80
|
+
with(:library).equal_to lib
|
81
|
+
end
|
82
|
+
end
|
83
|
+
unless language.blank?
|
84
|
+
language_list = language.split.uniq
|
85
|
+
language_list.each do |language|
|
86
|
+
with(:language).equal_to language
|
87
|
+
end
|
88
|
+
end
|
89
|
+
if defined?(EnjuSubject)
|
90
|
+
unless subject.blank?
|
91
|
+
with(:subject).equal_to subject_by_term.term
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
return search
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class ContentTypesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_content_type, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /content_types
|
4
6
|
# GET /content_types.json
|
5
7
|
def index
|
@@ -82,6 +84,15 @@ class ContentTypesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_content_type
|
88
|
+
@content_type = ContentType.find(params[:id])
|
89
|
+
authorize @content_type
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize ContentType
|
94
|
+
end
|
95
|
+
|
85
96
|
def content_type_params
|
86
97
|
params.require(:content_type).permit(:name, :display_name, :note)
|
87
98
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class CountriesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_country, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /countries
|
4
6
|
# GET /countries.json
|
5
7
|
def index
|
@@ -82,6 +84,15 @@ class CountriesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_country
|
88
|
+
@country = Country.find(params[:id])
|
89
|
+
authorize @country
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize Country
|
94
|
+
end
|
95
|
+
|
85
96
|
def country_params
|
86
97
|
params.require(:country).permit(
|
87
98
|
:name, :display_name, :alpha_2, :alpha_3, :numeric_3, :note
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class CreateTypesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_create_type, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /create_types
|
4
6
|
# GET /create_types.json
|
5
7
|
def index
|
6
|
-
@create_types = CreateType.
|
8
|
+
@create_types = CreateType.order(:position)
|
7
9
|
|
8
10
|
respond_to do |format|
|
9
11
|
format.html # index.html.erb
|
@@ -82,6 +84,15 @@ class CreateTypesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_create_type
|
88
|
+
@create_type = CreateType.find(params[:id])
|
89
|
+
authorize @create_type
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize CreateType
|
94
|
+
end
|
95
|
+
|
85
96
|
def create_type_params
|
86
97
|
params.require(:create_type).permit(:name, :display_name, :note, :position)
|
87
98
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreatesController < ApplicationController
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
before_action :set_create, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
before_action :get_agent, :get_work
|
5
|
+
before_action :prepare_options, only: [:new, :edit]
|
6
6
|
|
7
7
|
# GET /creates
|
8
8
|
# GET /creates.json
|
@@ -111,6 +111,15 @@ class CreatesController < ApplicationController
|
|
111
111
|
end
|
112
112
|
|
113
113
|
private
|
114
|
+
def set_create
|
115
|
+
@create = Create.find(params[:id])
|
116
|
+
authorize @create
|
117
|
+
end
|
118
|
+
|
119
|
+
def check_policy
|
120
|
+
authorize Create
|
121
|
+
end
|
122
|
+
|
114
123
|
def create_params
|
115
124
|
params.require(:create).permit(
|
116
125
|
:agent_id, :work_id, :create_type_id, :position
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class DonatesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_donate, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
3
4
|
|
4
5
|
# GET /donates
|
5
6
|
# GET /donates.json
|
@@ -78,6 +79,15 @@ class DonatesController < ApplicationController
|
|
78
79
|
end
|
79
80
|
|
80
81
|
private
|
82
|
+
def set_donate
|
83
|
+
@donate = Donate.find(params[:id])
|
84
|
+
authorize @donate
|
85
|
+
end
|
86
|
+
|
87
|
+
def check_policy
|
88
|
+
authorize Donate
|
89
|
+
end
|
90
|
+
|
81
91
|
def donate_params
|
82
92
|
params.require(:donate).permit(:agent_id, :item_id)
|
83
93
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class FormOfWorksController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_form_of_work, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /form_of_works
|
4
6
|
# GET /form_of_works.json
|
5
7
|
def index
|
6
|
-
@form_of_works = FormOfWork.
|
8
|
+
@form_of_works = FormOfWork.order(:position)
|
7
9
|
|
8
10
|
respond_to do |format|
|
9
11
|
format.html # index.html.erb
|
@@ -82,6 +84,15 @@ class FormOfWorksController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_form_of_work
|
88
|
+
@form_of_work = FormOfWork.find(params[:id])
|
89
|
+
authorize @form_of_work
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize FormOfWork
|
94
|
+
end
|
95
|
+
|
85
96
|
def form_of_work_params
|
86
97
|
params.require(:form_of_work).permit(:name, :display_name, :note)
|
87
98
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class FrequenciesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_frequency, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /frequencies
|
4
6
|
# GET /frequencies.json
|
5
7
|
def index
|
6
|
-
@frequencies = Frequency.
|
8
|
+
@frequencies = Frequency.order(:position)
|
7
9
|
|
8
10
|
respond_to do |format|
|
9
11
|
format.html # index.html.erb
|
@@ -82,6 +84,15 @@ class FrequenciesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_frequency
|
88
|
+
@frequency = Frequency.find(params[:id])
|
89
|
+
authorize @frequency
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize Frequency
|
94
|
+
end
|
95
|
+
|
85
96
|
def frequency_params
|
86
97
|
params.require(:frequency).permit(:name, :display_name, :note)
|
87
98
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class IdentifierTypesController < ApplicationController
|
2
|
-
|
2
|
+
before_action :set_identifier_type, only: [:show, :edit, :update, :destroy]
|
3
|
+
before_action :check_policy, only: [:index, :new, :create]
|
4
|
+
|
3
5
|
# GET /identifier_types
|
4
6
|
# GET /identifier_types.json
|
5
7
|
def index
|
6
|
-
@identifier_types = IdentifierType.
|
8
|
+
@identifier_types = IdentifierType.order(:position)
|
7
9
|
|
8
10
|
respond_to do |format|
|
9
11
|
format.html # index.html.erb
|
@@ -82,6 +84,15 @@ class IdentifierTypesController < ApplicationController
|
|
82
84
|
end
|
83
85
|
|
84
86
|
private
|
87
|
+
def set_identifier_type
|
88
|
+
@identifier_type = IdentifierType.find(params[:id])
|
89
|
+
authorize @identifier_type
|
90
|
+
end
|
91
|
+
|
92
|
+
def check_policy
|
93
|
+
authorize IdentifierType
|
94
|
+
end
|
95
|
+
|
85
96
|
def identifier_type_params
|
86
97
|
params.require(:identifier_type).permit(
|
87
98
|
:display_name, :name, :note, :position
|