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.
Files changed (342) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -3
  3. data/app/controllers/agent_import_files_controller.rb +13 -3
  4. data/app/controllers/agent_import_results_controller.rb +12 -1
  5. data/app/controllers/agent_merge_lists_controller.rb +11 -1
  6. data/app/controllers/agent_merges_controller.rb +12 -2
  7. data/app/controllers/agent_relationship_types_controller.rb +13 -2
  8. data/app/controllers/agent_relationships_controller.rb +13 -4
  9. data/app/controllers/agent_types_controller.rb +13 -2
  10. data/app/controllers/agents_controller.rb +18 -12
  11. data/app/controllers/carrier_types_controller.rb +12 -2
  12. data/app/controllers/concerns/enju_biblio/controller.rb +99 -0
  13. data/app/controllers/content_types_controller.rb +12 -1
  14. data/app/controllers/countries_controller.rb +12 -1
  15. data/app/controllers/create_types_controller.rb +13 -2
  16. data/app/controllers/creates_controller.rb +13 -4
  17. data/app/controllers/donates_controller.rb +11 -1
  18. data/app/controllers/form_of_works_controller.rb +13 -2
  19. data/app/controllers/frequencies_controller.rb +13 -2
  20. data/app/controllers/identifier_types_controller.rb +13 -2
  21. data/app/controllers/import_requests_controller.rb +19 -9
  22. data/app/controllers/items_controller.rb +25 -13
  23. data/app/controllers/languages_controller.rb +12 -1
  24. data/app/controllers/licenses_controller.rb +13 -2
  25. data/app/controllers/manifestation_relationship_types_controller.rb +12 -1
  26. data/app/controllers/manifestation_relationships_controller.rb +13 -4
  27. data/app/controllers/manifestations_controller.rb +58 -30
  28. data/app/controllers/medium_of_performances_controller.rb +13 -2
  29. data/app/controllers/owns_controller.rb +12 -3
  30. data/app/controllers/picture_files_controller.rb +13 -3
  31. data/app/controllers/produce_types_controller.rb +13 -2
  32. data/app/controllers/produces_controller.rb +13 -4
  33. data/app/controllers/realize_types_controller.rb +13 -2
  34. data/app/controllers/realizes_controller.rb +13 -4
  35. data/app/controllers/resource_export_files_controller.rb +13 -3
  36. data/app/controllers/resource_import_files_controller.rb +14 -4
  37. data/app/controllers/resource_import_results_controller.rb +12 -1
  38. data/app/controllers/series_statement_merge_lists_controller.rb +11 -1
  39. data/app/controllers/series_statement_merges_controller.rb +12 -2
  40. data/app/controllers/series_statements_controller.rb +13 -5
  41. data/app/helpers/manifestations_helper.rb +8 -8
  42. data/app/jobs/agent_import_file_job.rb +7 -0
  43. data/app/jobs/resource_export_file_job.rb +7 -0
  44. data/app/jobs/resource_import_file_job.rb +7 -0
  45. data/app/models/agent.rb +23 -1
  46. data/app/models/agent_import_file.rb +0 -1
  47. data/app/models/carrier_type.rb +0 -1
  48. data/app/models/identifier.rb +1 -1
  49. data/app/models/item.rb +2 -9
  50. data/app/models/manifestation.rb +180 -75
  51. data/app/models/picture_file.rb +1 -1
  52. data/app/models/resource_export_file.rb +5 -3
  53. data/app/models/resource_import_file.rb +34 -50
  54. data/app/models/series_statement.rb +8 -1
  55. data/app/policies/agent_import_file_policy.rb +21 -0
  56. data/app/policies/agent_import_result_policy.rb +21 -0
  57. data/app/policies/agent_merge_list_policy.rb +25 -0
  58. data/app/policies/agent_merge_policy.rb +25 -0
  59. data/app/policies/agent_policy.rb +30 -0
  60. data/app/policies/agent_relationship_policy.rb +21 -0
  61. data/app/policies/agent_relationship_type_policy.rb +21 -0
  62. data/app/policies/agent_type_policy.rb +23 -0
  63. data/app/policies/carrier_type_policy.rb +23 -0
  64. data/app/policies/content_type_policy.rb +23 -0
  65. data/app/policies/country_policy.rb +21 -0
  66. data/app/policies/create_policy.rb +21 -0
  67. data/app/policies/create_type_policy.rb +21 -0
  68. data/app/policies/donate_policy.rb +21 -0
  69. data/app/policies/form_of_work_policy.rb +21 -0
  70. data/app/policies/frequency_policy.rb +23 -0
  71. data/app/policies/identifier_type_policy.rb +23 -0
  72. data/app/policies/import_request_policy.rb +21 -0
  73. data/app/policies/item_policy.rb +27 -0
  74. data/app/policies/language_policy.rb +21 -0
  75. data/app/policies/license_policy.rb +21 -0
  76. data/app/policies/manifestation_policy.rb +67 -0
  77. data/app/policies/manifestation_relationship_policy.rb +21 -0
  78. data/app/policies/manifestation_relationship_type_policy.rb +21 -0
  79. data/app/policies/medium_of_performance_policy.rb +21 -0
  80. data/app/policies/own_policy.rb +21 -0
  81. data/app/policies/picture_file_policy.rb +32 -0
  82. data/app/policies/produce_policy.rb +21 -0
  83. data/app/policies/produce_type_policy.rb +21 -0
  84. data/app/policies/realize_policy.rb +21 -0
  85. data/app/policies/realize_type_policy.rb +21 -0
  86. data/app/policies/resource_export_file_policy.rb +21 -0
  87. data/app/policies/resource_import_file_policy.rb +21 -0
  88. data/app/policies/resource_import_result_policy.rb +21 -0
  89. data/app/policies/series_statement_merge_list_policy.rb +25 -0
  90. data/app/policies/series_statement_merge_policy.rb +25 -0
  91. data/app/policies/series_statement_policy.rb +25 -0
  92. data/app/views/agent_relationship_types/index.html.erb +4 -4
  93. data/app/views/agent_types/index.html.erb +4 -4
  94. data/app/views/agent_types/show.html.erb +1 -1
  95. data/app/views/agents/_agent.html.erb +2 -2
  96. data/app/views/agents/_index.html.erb +1 -1
  97. data/app/views/agents/_index_agent.html.erb +4 -4
  98. data/app/views/agents/_index_agent_merge_list.html.erb +2 -2
  99. data/app/views/agents/_index_expression.html.erb +3 -3
  100. data/app/views/agents/_index_manifestation.html.erb +3 -3
  101. data/app/views/agents/_index_work.html.erb +3 -3
  102. data/app/views/agents/edit.html.erb +1 -1
  103. data/app/views/agents/{index.mobile.erb → index.html+phone.erb} +0 -0
  104. data/app/views/agents/index.json.jbuilder +5 -0
  105. data/app/views/agents/index.rss.builder +2 -2
  106. data/app/views/agents/{show.mobile.erb → show.html+phone.erb} +0 -0
  107. data/app/views/agents/show.html.erb +3 -3
  108. data/app/views/carrier_types/_form.html.erb +1 -1
  109. data/app/views/carrier_types/index.html.erb +4 -4
  110. data/app/views/carrier_types/show.html.erb +1 -1
  111. data/app/views/content_types/index.html.erb +4 -4
  112. data/app/views/content_types/show.html.erb +1 -1
  113. data/app/views/countries/index.html.erb +3 -3
  114. data/app/views/countries/show.html.erb +1 -1
  115. data/app/views/create_types/index.html.erb +4 -4
  116. data/app/views/creates/_index.html.erb +2 -2
  117. data/app/views/creates/_index_agent.html.erb +3 -3
  118. data/app/views/creates/_index_work.html.erb +2 -2
  119. data/app/views/donates/index.html.erb +2 -2
  120. data/app/views/form_of_works/index.html.erb +4 -4
  121. data/app/views/form_of_works/show.html.erb +1 -1
  122. data/app/views/frequencies/index.html.erb +4 -4
  123. data/app/views/frequencies/show.html.erb +1 -1
  124. data/app/views/identifier_types/index.html.erb +4 -4
  125. data/app/views/identifier_types/show.html.erb +1 -1
  126. data/app/views/import_requests/index.html.erb +1 -1
  127. data/app/views/items/{_shelf_picture.mobile.erb → _shelf_picture.html+phone.erb} +0 -0
  128. data/app/views/items/edit.html.erb +2 -2
  129. data/app/views/items/{index.mobile.erb → index.html+phone.erb} +1 -1
  130. data/app/views/items/index.html.erb +2 -2
  131. data/app/views/items/new.html.erb +1 -5
  132. data/app/views/items/{show.mobile.erb → show.html+phone.erb} +0 -0
  133. data/app/views/items/show.html.erb +10 -6
  134. data/app/views/languages/index.html.erb +3 -3
  135. data/app/views/languages/show.html.erb +1 -1
  136. data/app/views/layouts/{agents.mobile.erb → agents.html+phone.erb} +1 -1
  137. data/app/views/layouts/agents.html.erb +2 -2
  138. data/app/views/layouts/{manifestations.mobile.erb → manifestations.html+phone.erb} +1 -1
  139. data/app/views/layouts/manifestations.html.erb +2 -2
  140. data/app/views/licenses/index.html.erb +4 -4
  141. data/app/views/manifestation_relationship_types/index.html.erb +4 -4
  142. data/app/views/manifestations/_attachment_file.html.erb +1 -1
  143. data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
  144. data/app/views/manifestations/_classification_facet.html.erb +2 -2
  145. data/app/views/manifestations/_contributor_fields.html.erb +4 -0
  146. data/app/views/manifestations/_creator_fields.html.erb +5 -0
  147. data/app/views/manifestations/_edit_detail.html.erb +1 -1
  148. data/app/views/manifestations/_export_list.html.erb +3 -3
  149. data/app/views/manifestations/_form.html.erb +25 -30
  150. data/app/views/manifestations/_holding.html.erb +6 -8
  151. data/app/views/manifestations/_identifier_fields.html.erb +5 -0
  152. data/app/views/manifestations/_index_form_contributor.html.erb +2 -2
  153. data/app/views/manifestations/_index_form_creator.html.erb +2 -2
  154. data/app/views/manifestations/_index_form_item.html.erb +2 -2
  155. data/app/views/manifestations/_index_form_manifestation.html.erb +2 -2
  156. data/app/views/manifestations/_index_form_parent.html.erb +1 -1
  157. data/app/views/manifestations/_index_form_publisher.html.erb +2 -2
  158. data/app/views/manifestations/_index_form_series_statement.html.erb +2 -2
  159. data/app/views/manifestations/_language_facet.html.erb +1 -1
  160. data/app/views/manifestations/_library_facet.html.erb +1 -1
  161. data/app/views/manifestations/_manifestation.html.erb +6 -2
  162. data/app/views/manifestations/_manifestation.txt.erb +1 -1
  163. data/app/views/manifestations/_paginate_id_store.html.erb +8 -6
  164. data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
  165. data/app/views/manifestations/_publisher_fields.html.erb +4 -0
  166. data/app/views/manifestations/_reservable_facet.html.erb +2 -2
  167. data/app/views/manifestations/_series_statement_fields.html.erb +13 -0
  168. data/app/views/manifestations/_show.rdf.builder +3 -87
  169. data/app/views/manifestations/{_show_creators.mobile.erb → _show_creators.html+phone.erb} +0 -0
  170. data/app/views/manifestations/_show_creators.html.erb +0 -1
  171. data/app/views/manifestations/_show_detail_librarian.html.erb +20 -22
  172. data/app/views/manifestations/_show_detail_user.html.erb +13 -15
  173. data/app/views/manifestations/{_show_holding.mobile.erb → _show_holding.html+phone.erb} +0 -0
  174. data/app/views/manifestations/_show_holding.html.erb +1 -1
  175. data/app/views/manifestations/{_show_index.mobile.erb → _show_index.html+phone.erb} +0 -0
  176. data/app/views/manifestations/_submenu_parent.html.erb +3 -3
  177. data/app/views/manifestations/{_title.mobile.erb → _title.html+phone.erb} +0 -0
  178. data/app/views/manifestations/edit.html.erb +2 -6
  179. data/app/views/manifestations/{index.mobile.erb → index.html+phone.erb} +0 -0
  180. data/app/views/manifestations/index.html.erb +40 -24
  181. data/app/views/manifestations/index.rdf.builder +5 -3
  182. data/app/views/manifestations/index.rss.builder +2 -2
  183. data/app/views/manifestations/index.txt.erb +1 -2
  184. data/app/views/manifestations/{show.mobile.erb → show.html+phone.erb} +1 -1
  185. data/app/views/manifestations/show.html.erb +1 -1
  186. data/app/views/manifestations/show.txt.erb +1 -2
  187. data/app/views/medium_of_performances/index.html.erb +4 -4
  188. data/app/views/owns/index.html.erb +2 -2
  189. data/app/views/picture_files/_index.html.erb +3 -3
  190. data/app/views/picture_files/_index_agent.html.erb +4 -4
  191. data/app/views/picture_files/_index_manifestation.html.erb +4 -4
  192. data/app/views/picture_files/{_link.mobile.erb → _link.html+phone.erb} +0 -0
  193. data/app/views/picture_files/{show.mobile.erb → show.html+phone.erb} +0 -0
  194. data/app/views/produce_types/index.html.erb +4 -4
  195. data/app/views/produces/_index.html.erb +2 -2
  196. data/app/views/produces/_index_agent.html.erb +2 -2
  197. data/app/views/produces/_index_manifestation.html.erb +2 -2
  198. data/app/views/realize_types/index.html.erb +4 -4
  199. data/app/views/realizes/_index.html.erb +2 -2
  200. data/app/views/realizes/_index_agent.html.erb +2 -2
  201. data/app/views/realizes/_index_expression.html.erb +2 -2
  202. data/app/views/series_statement_merges/show.html.erb +0 -2
  203. data/app/views/series_statements/_index.html.erb +4 -4
  204. data/app/views/series_statements/_index_series_statement_merge_list.html.erb +2 -2
  205. data/app/views/series_statements/show.html.erb +1 -1
  206. data/config/locales/translation_en.yml +13 -0
  207. data/config/locales/translation_ja.yml +13 -0
  208. data/config/routes.rb +3 -43
  209. data/lib/enju_biblio/engine.rb +0 -1
  210. data/lib/enju_biblio/version.rb +1 -1
  211. data/lib/enju_biblio.rb +0 -107
  212. data/lib/tasks/enju_biblio_tasks.rake +1 -1
  213. data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +43 -43
  214. 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
  215. 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
  216. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +44 -44
  217. 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
  218. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +41 -41
  219. data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +50 -50
  220. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +49 -49
  221. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +45 -45
  222. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +50 -50
  223. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +48 -48
  224. 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
  225. 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
  226. data/spec/controllers/agent_import_files_controller_spec.rb +5 -5
  227. data/spec/controllers/agent_import_results_controller_spec.rb +3 -3
  228. data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
  229. data/spec/controllers/agent_merges_controller_spec.rb +9 -9
  230. data/spec/controllers/agent_relationship_types_controller_spec.rb +14 -14
  231. data/spec/controllers/agent_relationships_controller_spec.rb +9 -9
  232. data/spec/controllers/agent_types_controller_spec.rb +2 -2
  233. data/spec/controllers/agents_controller_spec.rb +8 -8
  234. data/spec/controllers/carrier_types_controller_spec.rb +1 -1
  235. data/spec/controllers/content_types_controller_spec.rb +1 -1
  236. data/spec/controllers/countries_controller_spec.rb +10 -10
  237. data/spec/controllers/create_types_controller_spec.rb +2 -2
  238. data/spec/controllers/creates_controller_spec.rb +7 -7
  239. data/spec/controllers/donates_controller_spec.rb +9 -9
  240. data/spec/controllers/form_of_works_controller_spec.rb +2 -2
  241. data/spec/controllers/frequencies_controller_spec.rb +2 -2
  242. data/spec/controllers/identifier_types_controller_spec.rb +2 -2
  243. data/spec/controllers/import_requests_controller_spec.rb +9 -9
  244. data/spec/controllers/items_controller_spec.rb +13 -7
  245. data/spec/controllers/languages_controller_spec.rb +8 -8
  246. data/spec/controllers/licenses_controller_spec.rb +2 -2
  247. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +10 -10
  248. data/spec/controllers/manifestation_relationships_controller_spec.rb +9 -9
  249. data/spec/controllers/manifestations_controller_spec.rb +86 -12
  250. data/spec/controllers/medium_of_performances_controller_spec.rb +2 -2
  251. data/spec/controllers/owns_controller_spec.rb +7 -7
  252. data/spec/controllers/picture_files_controller_spec.rb +9 -9
  253. data/spec/controllers/produce_types_controller_spec.rb +2 -2
  254. data/spec/controllers/produces_controller_spec.rb +7 -7
  255. data/spec/controllers/realize_types_controller_spec.rb +2 -2
  256. data/spec/controllers/realizes_controller_spec.rb +7 -7
  257. data/spec/controllers/resource_export_files_controller_spec.rb +9 -15
  258. data/spec/controllers/resource_import_files_controller_spec.rb +7 -7
  259. data/spec/controllers/resource_import_results_controller_spec.rb +3 -3
  260. data/spec/controllers/series_statement_merge_lists_controller_spec.rb +9 -9
  261. data/spec/controllers/series_statement_merges_controller_spec.rb +9 -9
  262. data/spec/controllers/series_statements_controller_spec.rb +7 -7
  263. data/spec/dummy/app/assets/javascripts/application.js +0 -2
  264. data/spec/dummy/app/controllers/application_controller.rb +10 -6
  265. data/spec/dummy/app/models/user.rb +4 -4
  266. data/spec/dummy/config/application.rb +13 -41
  267. data/spec/dummy/config/environments/development.rb +22 -18
  268. data/spec/dummy/config/environments/production.rb +46 -34
  269. data/spec/dummy/config/environments/test.rb +19 -14
  270. data/spec/dummy/config/initializers/assets.rb +1 -1
  271. data/spec/dummy/config/initializers/enju_leaf.rb +8 -0
  272. data/spec/dummy/config/routes.rb +3 -0
  273. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
  274. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
  275. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
  276. data/spec/dummy/db/schema.rb +27 -2
  277. data/spec/factories/classification_type.rb +5 -0
  278. data/spec/factories/reserve.rb +12 -0
  279. data/spec/factories/role.rb +9 -0
  280. data/spec/factories/subject.rb +7 -0
  281. data/spec/factories/subject_heading_type.rb +5 -0
  282. data/spec/factories/subject_heading_type_has_subject.rb +6 -0
  283. data/spec/factories/subject_type.rb +5 -0
  284. data/spec/fixtures/checked_items.yml +4 -4
  285. data/spec/fixtures/checkouts.yml +12 -12
  286. data/spec/fixtures/classification_types.yml +1 -1
  287. data/spec/fixtures/classifications.yml +1 -0
  288. data/spec/fixtures/manifestations.yml +4 -4
  289. data/spec/fixtures/reserves.yml +16 -16
  290. data/spec/fixtures/subjects.yml +79 -0
  291. data/spec/models/agent_import_file_spec.rb +1 -1
  292. data/spec/models/manifestation_spec.rb +27 -13
  293. data/spec/models/resource_export_file_spec.rb +15 -2
  294. data/spec/models/resource_import_file_spec.rb +29 -9
  295. data/spec/models/series_statement_merge_list_spec.rb +1 -1
  296. data/spec/policies/manifestation_policy_spec.rb +24 -0
  297. data/spec/rails_helper.rb +82 -0
  298. data/spec/spec_helper.rb +81 -56
  299. data/spec/support/devise.rb +2 -2
  300. data/spec/support/vcr.rb +8 -0
  301. data/spec/views/agent_types/index.html.erb_spec.rb +2 -1
  302. data/spec/views/agent_types/show.html.erb_spec.rb +1 -0
  303. data/spec/views/create_types/index.html.erb_spec.rb +2 -1
  304. data/spec/views/creates/edit.html.erb_spec.rb +0 -3
  305. data/spec/views/creates/index.html.erb_spec.rb +2 -4
  306. data/spec/views/creates/new.html.erb_spec.rb +0 -3
  307. data/spec/views/creates/show.html.erb_spec.rb +0 -3
  308. data/spec/views/import_requests/index.html.erb_spec.rb +3 -2
  309. data/spec/views/manifestations/index.html.erb_spec.rb +25 -0
  310. data/spec/views/manifestations/index.rdf.builder_spec.rb +23 -0
  311. data/spec/views/manifestations/index.txt.erb_spec.rb +17 -0
  312. data/spec/views/manifestations/show.html.erb_spec.rb +2 -3
  313. data/spec/views/manifestations/show.txt.erb_spec.rb +16 -0
  314. data/spec/views/owns/edit.html.erb_spec.rb +0 -3
  315. data/spec/views/owns/index.html.erb_spec.rb +2 -4
  316. data/spec/views/owns/new.html.erb_spec.rb +0 -3
  317. data/spec/views/owns/show.html.erb_spec.rb +0 -3
  318. data/spec/views/produce_types/index.html.erb_spec.rb +2 -1
  319. data/spec/views/produces/edit.html.erb_spec.rb +0 -3
  320. data/spec/views/produces/index.html.erb_spec.rb +2 -4
  321. data/spec/views/produces/new.html.erb_spec.rb +0 -3
  322. data/spec/views/produces/show.html.erb_spec.rb +0 -3
  323. data/spec/views/realize_types/index.html.erb_spec.rb +2 -1
  324. data/spec/views/realizes/edit.html.erb_spec.rb +0 -3
  325. data/spec/views/realizes/index.html.erb_spec.rb +2 -4
  326. data/spec/views/realizes/new.html.erb_spec.rb +0 -3
  327. data/spec/views/realizes/show.html.erb_spec.rb +0 -3
  328. data/spec/views/resource_import_files/index.html.erb_spec.rb +0 -3
  329. data/spec/views/resource_import_files/{show.html.erb_spec.erb → show.html.erb_spec.rb} +0 -3
  330. data/spec/views/resource_import_results/index.html.erb_spec.rb +0 -3
  331. data/spec/views/resource_import_results/{show.html.erb_spec.erb → show.html.erb_spec.rb} +1 -4
  332. data/spec/views/series_statement_merge_lists/index.html.erb_spec.rb +1 -1
  333. data/spec/views/series_statement_merges/edit.html.erb_spec.rb +0 -3
  334. data/spec/views/series_statement_merges/index.html.erb_spec.rb +0 -3
  335. data/spec/views/series_statement_merges/new.html.erb_spec.rb +0 -3
  336. data/spec/views/series_statement_merges/show.html.erb_spec.rb +0 -3
  337. metadata +170 -131
  338. data/app/models/enju_biblio/ability.rb +0 -238
  339. data/app/workers/agent_import_file_queue.rb +0 -7
  340. data/app/workers/resource_export_file_queue.rb +0 -7
  341. data/app/workers/resource_import_file_queue.rb +0 -7
  342. data/spec/dummy/config/application.yml +0 -42
@@ -24,7 +24,7 @@
24
24
  <%= render 'manifestations/show_index', manifestation: own.item.manifestation -%>
25
25
  </td>
26
26
  <td>
27
- <%- if can? :delete, own -%>
27
+ <%- if policy(own).destroy? -%>
28
28
  <%= link_to t('page.show'), own -%>
29
29
  <%= link_to t('page.destroy'), own, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
30
30
  <%- end -%>
@@ -39,7 +39,7 @@
39
39
 
40
40
  <div id="submenu" class="ui-corner-all ui-widget-content">
41
41
  <ul>
42
- <%- if can? :create, Own -%>
42
+ <%- if policy(Own).create? -%>
43
43
  <li><%= link_to t('page.new', model: t('activerecord.models.own')), new_own_path -%></li>
44
44
  <%- end -%>
45
45
  </ul>
@@ -24,10 +24,10 @@
24
24
  <td><%= link_to h(picture_file.picture_file_name), picture_file_path(picture_file, format: :download, size: 'original') -%></td>
25
25
  <td>
26
26
  <%= link_to t('page.show'), picture_file -%>
27
- <%- if can? :update, picture_file -%>
27
+ <%- if policy(picture_file).update? -%>
28
28
  <%= link_to t('page.edit'), edit_picture_file_path(picture_file) -%>
29
29
  <% end %>
30
- <%- if can? :delete, picture_file -%>
30
+ <%- if policy(picture_file).destroy? -%>
31
31
  <%= link_to t('page.destroy'), picture_file, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
32
32
  <%- end -%>
33
33
  </td>
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
 
42
42
  <div id="submenu" class="ui-corner-all ui-widget-content">
43
- <%- if can? :create, PictureFile -%>
43
+ <%- if policy(PictureFile).create? -%>
44
44
  <ul>
45
45
  <li><%= link_to t('page.listing', model: t('activerecord.models.manifestation')), manifestations_path -%></li>
46
46
  <li><%= link_to t('page.listing', model: t('activerecord.models.shelf')), shelves_path -%></li>
@@ -19,7 +19,7 @@
19
19
  <%- @picture_files.each do |picture_file| -%>
20
20
  <tr class="line<%= cycle("0", "1") -%>">
21
21
  <td>
22
- <%- if can? :update, picture_file -%>
22
+ <%- if policy(picture_file).update? -%>
23
23
  <%= move_position(picture_file) -%>
24
24
  <%- end -%>
25
25
  </td>
@@ -31,10 +31,10 @@
31
31
  <td><%= link_to picture_file.picture_file_name, picture_file_path(picture_file, format: :download, size: 'original') -%></td>
32
32
  <td>
33
33
  <%= link_to t('page.show'), picture_file -%>
34
- <%- if can? :update, picture_file -%>
34
+ <%- if policy(picture_file).update? -%>
35
35
  <%= link_to t('page.edit'), edit_picture_file_path(picture_file) -%>
36
36
  <% end %>
37
- <%- if can? :delete, picture_file -%>
37
+ <%- if policy(picture_file).destroy? -%>
38
38
  <%= link_to t('page.destroy'), picture_file_path(picture_file, agent_id: agent.id), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
39
39
  <%- end -%>
40
40
  </td>
@@ -47,7 +47,7 @@
47
47
  </div>
48
48
 
49
49
  <div id="submenu" class="ui-corner-all ui-widget-content">
50
- <%- if can? :create, PictureFile -%>
50
+ <%- if policy(PictureFile).create? -%>
51
51
  <ul>
52
52
  <li><%= link_to t('page.new', model: t('activerecord.models.picture_file')), new_picture_file_path(agent_id: agent.id) -%></li>
53
53
  <li><%= link_to t('picture_file.all_picture'), picture_files_path -%></li>
@@ -19,7 +19,7 @@
19
19
  <%- @picture_files.each do |picture_file| -%>
20
20
  <tr class="line<%= cycle("0", "1") -%>">
21
21
  <td>
22
- <%- if can? :update, picture_file -%>
22
+ <%- if policy(picture_file).update? -%>
23
23
  <%= move_position(picture_file) -%>
24
24
  <%- end -%>
25
25
  </td>
@@ -31,10 +31,10 @@
31
31
  <td><%= link_to picture_file.picture_file_name, picture_file_path(picture_file, format: :download, size: 'original') -%></td>
32
32
  <td>
33
33
  <%= link_to t('page.show'), picture_file -%>
34
- <%- if can? :update, picture_file -%>
34
+ <%- if policy(picture_file).update? -%>
35
35
  <%= link_to t('page.edit'), edit_picture_file_path(picture_file) -%>
36
36
  <% end %>
37
- <%- if can? :delete, picture_file -%>
37
+ <%- if policy(picture_file).destroy? -%>
38
38
  <%= link_to t('page.destroy'), picture_file, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
39
39
  <%- end -%>
40
40
  </td>
@@ -47,7 +47,7 @@
47
47
  </div>
48
48
 
49
49
  <div id="submenu" class="ui-corner-all ui-widget-content">
50
- <%- if can? :create, PictureFile -%>
50
+ <%- if policy(PictureFile).create? -%>
51
51
  <ul>
52
52
  <li><%= link_to t('page.new', model: t('activerecord.models.picture_file')), new_picture_file_path(manifestation_id: manifestation) -%></li>
53
53
  <li><%= link_to t('picture_file.all_picture'), picture_files_path -%></li>
@@ -18,7 +18,7 @@
18
18
  <%- @produce_types.each do |produce_type| -%>
19
19
  <tr class="line<%= cycle("0", "1") -%>">
20
20
  <td>
21
- <%- if can? :update, produce_type -%>
21
+ <%- if policy(produce_type).update? -%>
22
22
  <%= move_position(produce_type) -%>
23
23
  <%- end -%>
24
24
  </td>
@@ -29,10 +29,10 @@
29
29
  <%= produce_type.note %>
30
30
  </td>
31
31
  <td>
32
- <%- if can? :update, produce_type -%>
32
+ <%- if policy(produce_type).update? -%>
33
33
  <%= link_to t('page.edit'), edit_produce_type_path(produce_type) -%>
34
34
  <% end %>
35
- <%- if can? :delete, produce_type -%>
35
+ <%- if policy(produce_type).destroy? -%>
36
36
  <%= link_to t('page.destroy'), produce_type_path(produce_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
37
37
  <%- end -%>
38
38
  </td>
@@ -45,7 +45,7 @@
45
45
 
46
46
  <div id="submenu" class="ui-corner-all ui-widget-content">
47
47
  <ul>
48
- <%- if can? :create, ProduceType -%>
48
+ <%- if policy(ProduceType).create? -%>
49
49
  <li><%= link_to t('page.new', model: t('activerecord.models.produce_type')), new_produce_type_path -%></li>
50
50
  <%- end -%>
51
51
  </ul>
@@ -14,7 +14,7 @@
14
14
  <td><%= link_to produce.agent.full_name, produce.agent -%></td>
15
15
  <td><%= link_to produce.manifestation_original_title, produce.manifestation -%></td>
16
16
  <td>
17
- <%- if can? :delete, produce -%>
17
+ <%- if policy(produce).destroy? -%>
18
18
  <%= link_to t('page.show'), produce -%>
19
19
  <%= link_to t('page.destroy'), produce, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
20
20
  <%- end -%>
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
 
30
30
  <div id="submenu" class="ui-corner-all ui-widget-content">
31
- <%- if can? :create, Produce -%>
31
+ <%- if policy(Produce).create? -%>
32
32
  <ul>
33
33
  <li><%= link_to t('page.new', model: t('activerecord.models.produce')), new_produce_path -%></li>
34
34
  </ul>
@@ -18,7 +18,7 @@
18
18
  <td><%= l(produce.created_at) -%></td>
19
19
  <td><%= l(produce.updated_at) -%></td>
20
20
  <td>
21
- <%- if can? :delete, produce -%>
21
+ <%- if policy(produce).destroy? -%>
22
22
  <%= link_to t('page.destroy'), produce_path(produce, agent_id: agent.id), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
23
23
  <%- end -%>
24
24
  </td>
@@ -33,7 +33,7 @@
33
33
 
34
34
  <div id="submenu" class="ui-corner-all ui-widget-content">
35
35
  <ul>
36
- <%- if can? :create, Produce -%>
36
+ <%- if policy(Produce).create? -%>
37
37
  <li><%= link_to t('page.new', model: t('activerecord.models.produce')), new_produce_path(agent_id: agent.id) -%></li>
38
38
  <%- end -%>
39
39
  </ul>
@@ -16,7 +16,7 @@
16
16
  <%- @produces.each do |produce| -%>
17
17
  <tr class="line<%= cycle("0", "1") -%>">
18
18
  <td>
19
- <%- if can? :delete, produce -%>
19
+ <%- if policy(produce).update? -%>
20
20
  <%= produce.first? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_up.png', size: '16x16', alt: t('page.asc')), manifestation_produce_path(produce.manifestation, produce, move: 'higher'), method: :put) -%>
21
21
  <%= produce.last? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_down.png', size: '16x16', alt: t('page.desc')), manifestation_produce_path(produce.manifestation, produce, move: 'lower'), method: :put) -%>
22
22
  <%- end -%>
@@ -36,7 +36,7 @@
36
36
  <div id="submenu" class="ui-corner-all ui-widget-content">
37
37
  <ul>
38
38
  <li><%= link_to t('page.listing', model: t('activerecord.models.agent')), agents_path(manifestation_id: manifestation.id) -%></li>
39
- <%- if can? :create, Produce -%>
39
+ <%- if policy(Produce).create? -%>
40
40
  <li><%= link_to t('page.new', model: t('activerecord.models.produce')), new_produce_path(manifestation_id: manifestation.id) -%></li>
41
41
  <%- end -%>
42
42
  </ul>
@@ -18,7 +18,7 @@
18
18
  <%- @realize_types.each do |realize_type| -%>
19
19
  <tr class="line<%= cycle("0", "1") -%>">
20
20
  <td>
21
- <%- if can? :update, realize_type -%>
21
+ <%- if policy(realize_type).update? -%>
22
22
  <%= move_position(realize_type) -%>
23
23
  <%- end -%>
24
24
  </td>
@@ -29,10 +29,10 @@
29
29
  <%= realize_type.note %>
30
30
  </td>
31
31
  <td>
32
- <%- if can? :update, realize_type -%>
32
+ <%- if policy(realize_type).update? -%>
33
33
  <%= link_to t('page.edit'), edit_realize_type_path(realize_type) -%>
34
34
  <% end %>
35
- <%- if can? :delete, realize_type -%>
35
+ <%- if policy(realize_type).destroy? -%>
36
36
  <%= link_to t('page.destroy'), realize_type_path(realize_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
37
37
  <%- end -%>
38
38
  </td>
@@ -45,7 +45,7 @@
45
45
 
46
46
  <div id="submenu" class="ui-corner-all ui-widget-content">
47
47
  <ul>
48
- <%- if can? :create, RealizeType -%>
48
+ <%- if policy(RealizeType).create? -%>
49
49
  <li><%= link_to t('page.new', model: t('activerecord.models.realize_type')), new_realize_type_path -%></li>
50
50
  <%- end -%>
51
51
  </ul>
@@ -14,7 +14,7 @@
14
14
  <td><%= link_to realize.agent.full_name, realize.agent -%></td>
15
15
  <td><%= link_to realize.expression.original_title, realize.expression -%></td>
16
16
  <td>
17
- <%- if can? :delete, realize -%>
17
+ <%- if policy(realize).destroy? -%>
18
18
  <%= link_to t('page.show'), realize -%>
19
19
  <%= link_to t('page.destroy'), realize, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
20
20
  <%- end -%>
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
 
30
30
  <div id="submenu" class="ui-corner-all ui-widget-content">
31
- <%- if can? :create, Realize -%>
31
+ <%- if policy(Realize).create? -%>
32
32
  <ul>
33
33
  <li><%= link_to t('page.new', model: t('activerecord.models.realize')), new_realize_path -%></li>
34
34
  </ul>
@@ -18,7 +18,7 @@
18
18
  <td><%= l(realize.created_at) -%></td>
19
19
  <td><%= l(realize.updated_at) -%></td>
20
20
  <td>
21
- <%- if can? :delete, realize -%>
21
+ <%- if policy(realize).destroy? -%>
22
22
  <%= link_to t('page.destroy'), realize_path(realize, agent_id: agent.id), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
23
23
  <%- end -%>
24
24
  </td>
@@ -33,7 +33,7 @@
33
33
 
34
34
  <div id="submenu" class="ui-corner-all ui-widget-content">
35
35
  <ul>
36
- <%- if can? :create, Realize -%>
36
+ <%- if policy(Realize).create? -%>
37
37
  <li><%= link_to t('page.new', model: t('activerecord.models.realize')), new_realize_path(agent_id: agent.id) -%></li>
38
38
  <%- end -%>
39
39
  </ul>
@@ -16,7 +16,7 @@
16
16
  <%- @realizes.each do |realize| -%>
17
17
  <tr class="line<%= cycle("0", "1") -%>">
18
18
  <td>
19
- <%- if can? :delete, realize -%>
19
+ <%- if policy(realize).destroy? -%>
20
20
  <%= realize.first? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_up.png', size: '16x16', alt: t('page.asc')), expression_realize_path(realize.expression, realize, move: 'higher'), method: :put) -%>
21
21
  <%= realize.last? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_down.png', size: '16x16', alt: t('page.desc')), expression_realize_path(realize.expression, realize, move: 'lower'), method: :put) -%>
22
22
  <%- end -%>
@@ -36,7 +36,7 @@
36
36
  <div id="submenu" class="ui-corner-all ui-widget-content">
37
37
  <ul>
38
38
  <li><%= link_to t('page.listing', model: t('activerecord.models.agent')), agents_path(expression_id: expression.id) -%></li>
39
- <%- if can? :create, Realize -%>
39
+ <%- if policy(Realize).create? -%>
40
40
  <li><%= link_to t('page.new', model: t('activerecord.models.realize')), new_realize_path(expression_id: expression.id) -%></li>
41
41
  <%- end -%>
42
42
  </ul>
@@ -20,8 +20,6 @@
20
20
  <ul>
21
21
  <li><%= link_to t('page.add', model: t('activerecord.models.series_statement')), series_statement_merge_list_series_statements_path(@series_statement_merge.series_statement_merge_list) -%></li>
22
22
  <li><%= link_to t('page.edit'), edit_series_statement_merge_path(@series_statement_merge) -%></li>
23
- <!--
24
23
  <li><%= back_to_index(flash[:page_info]) -%></li>
25
- -->
26
24
  </ul>
27
25
  </div>
@@ -23,7 +23,7 @@
23
23
  <% @series_statements.each do |series_statement| %>
24
24
  <tr class="line<%= cycle("0", "1") -%>">
25
25
  <td>
26
- <%- if @query.present? and can? :update, series_statement -%>
26
+ <%- if @query.present? and policy(series_statement).update? -%>
27
27
  <%= move_position(series_statement) -%>
28
28
  <%- end -%>
29
29
  </td>
@@ -31,8 +31,8 @@
31
31
  <strong><%= link_to series_statement.original_title, series_statement %></strong>
32
32
  </td>
33
33
  <td>
34
- <%= link_to t('page.edit'), edit_series_statement_path(series_statement) if can? :update, series_statement -%>
35
- <%= link_to t('page.destroy'), series_statement, data: {confirm: t('page.are_you_sure')}, method: :delete if can? :delete, series_statement -%>
34
+ <%= link_to t('page.edit'), edit_series_statement_path(series_statement) if policy(series_statement).update? -%>
35
+ <%= link_to t('page.destroy'), series_statement, data: {confirm: t('page.are_you_sure')}, method: :delete if policy(series_statement).destroy? -%>
36
36
  </td>
37
37
  </tr>
38
38
  <% end %>
@@ -45,7 +45,7 @@
45
45
 
46
46
  <div id="submenu" class="ui-corner-all ui-widget-content">
47
47
  <ul>
48
- <% if can? :create, SeriesStatement %>
48
+ <% if policy(SeriesStatement).create? %>
49
49
  <li><%= link_to t('page.new', model: t('activerecord.models.series_statement')), new_series_statement_path -%></li>
50
50
  <% end %>
51
51
  </ul>
@@ -7,7 +7,7 @@
7
7
  <%= form_for :series_statements, url: series_statement_merge_list_series_statements_path(@series_statement_merge_list), html: {method: 'get'} do -%>
8
8
  <p>
9
9
  <%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
10
- <%- if can? :update, @series_statement_merge_list -%>
10
+ <%- if policy(@series_statement_merge_list).update? -%>
11
11
  <%= render 'page/add' %>
12
12
  <%- end -%>
13
13
  <%= submit_tag t('page.search') -%>
@@ -28,7 +28,7 @@
28
28
  <td><%= link_to series_statement.original_title, series_statement_merge_list_series_statement_path(@series_statement_merge_list, series_statement) -%></td>
29
29
  <td><%= series_statement.series_statement_identifier -%></td>
30
30
  <td>
31
- <%- if can? :delete, series_statement -%>
31
+ <%- if policy(series_statement).destroy? -%>
32
32
  <%- if params[:mode] == 'add' -%>
33
33
  <%= link_to t('page.add'), new_series_statement_merge_list_series_statement_merge_path(@series_statement_merge_list, series_statement_id: series_statement.id) unless @series_statement_merge_list.series_statements.include?(series_statement) -%>
34
34
  <%- else -%>
@@ -33,7 +33,7 @@
33
33
 
34
34
  <div id="submenu" class="ui-corner-all ui-widget-content">
35
35
  <ul>
36
- <% if can? :update, @series_statement %>
36
+ <% if policy(@series_statement).update? %>
37
37
  <li><%= link_to t('page.edit'), edit_series_statement_path(@series_statement) %></li>
38
38
  <% end %>
39
39
  <li><%= back_to_index(flash[:page_info]) %></li>
@@ -42,6 +42,7 @@ en:
42
42
  agent_merge: Patron merge
43
43
  series_statement_merge: Series statement merge
44
44
  series_statement_merge_list: Series statement merge list
45
+ periodical: Periodical
45
46
 
46
47
  attributes:
47
48
  manifestation:
@@ -376,6 +377,7 @@ en:
376
377
  invalid_isbn: "Invalid ISBN."
377
378
  already_imported: "This manifestation is already imported."
378
379
  record_not_found: "Record not found."
380
+ record_not_added: "Record not added."
379
381
  add: "Add a manifestation"
380
382
  specify_expression: "Specify the expression."
381
383
  pickup: "Pick up"
@@ -415,6 +417,17 @@ en:
415
417
  merge: "Merge!"
416
418
  merge_resource: "Merge %{model}"
417
419
  new_acquisition: Acquisition
420
+ per_page: "%{num} records per page"
421
+ new_item: New item
422
+ sort_criteria:
423
+ created_at: "Created at"
424
+ date_asc: Oldest
425
+ date_desc: Newest
426
+ score_asc: Score Asc
427
+ score_desc: Score Desc
428
+ title_asc: A-Z
429
+ title_desc: Z-A
430
+ score: Score
418
431
 
419
432
  merge_list:
420
433
  successfully_merged: "%{model} were merged successfully."
@@ -42,6 +42,7 @@ ja:
42
42
  agent_merge: 人物・団体の統合
43
43
  series_statement_merge_list: シリーズ情報統合リスト
44
44
  series_statement_merge: シリーズ情報の統合
45
+ periodical: 逐次刊行物
45
46
 
46
47
  attributes:
47
48
  manifestation:
@@ -380,6 +381,7 @@ ja:
380
381
  invalid_isbn: "無効なISBNです。"
381
382
  already_imported: "すでにインポートされています。"
382
383
  record_not_found: "資料が見つかりませんでした。"
384
+ record_not_added: "資料がまだ登録されていません。"
383
385
  add: "資料を追加する"
384
386
  specify_expression: "協力した資料を指定してください。"
385
387
  pickup: "ピックアップ"
@@ -419,6 +421,17 @@ ja:
419
421
  merge: "統合する(取り消しはできません)"
420
422
  merge_resource: "%{model}を統合する"
421
423
  new_acquisition: 新規受入
424
+ per_page: "%{num}件ずつ表示"
425
+ new_item: 所蔵作成
426
+ sort_criteria:
427
+ created_at: 書誌作成日
428
+ date_asc: 古い順
429
+ date_desc: 新しい順
430
+ score_asc: 適合度逆順
431
+ score_desc: 適合度順
432
+ title_asc: 50音順
433
+ title_desc: 50音逆順
434
+ score: スコア
422
435
 
423
436
  merge_list:
424
437
  successfully_merged: "%{model}は正常に統合されました。"
data/config/routes.rb CHANGED
@@ -5,51 +5,11 @@ Rails.application.routes.draw do
5
5
 
6
6
  get "/manifestations/:manifestation_id/items" => redirect("/items?manifestation_id=%{manifestation_id}")
7
7
 
8
- resources :manifestations do
9
- resources :agents
10
- resources :produces
11
- resources :series_statements
12
- resources :picture_files
13
- resources :manifestations
14
- resources :manifestation_relationships
15
- end
16
-
17
- resources :items do
18
- resources :agents
19
- resources :owns
20
- resources :manifestations, :only => [:index]
21
- end
22
-
23
- resources :agents do
24
- resources :works, :controller => 'manifestations'
25
- resources :expressions, :controller => 'manifestations'
26
- resources :manifestations
27
- resources :items
28
- resources :agents
29
- resources :agent_relationships
30
- end
8
+ resources :manifestations
31
9
 
32
- resources :works, :controller => 'manifestations', :except => [:index, :new, :create] do
33
- resources :agents
34
- resources :creates
35
- end
36
-
37
- resources :expressions, :controller => 'manifestations', :except => [:index, :new, :create] do
38
- resources :agents
39
- resources :realizes
40
- end
10
+ resources :items
41
11
 
42
- resources :creators, :controller => 'agents', :except => [:index, :new, :create] do
43
- resources :manifestations
44
- end
45
-
46
- resources :contributors, :controller => 'agents', :except => [:index, :new, :create] do
47
- resources :manifestations
48
- end
49
-
50
- resources :publishers, :controller => 'agents', :except => [:index, :new, :create] do
51
- resources :manifestations
52
- end
12
+ resources :agents
53
13
 
54
14
  resources :creates
55
15
  resources :create_types
@@ -4,7 +4,6 @@ require 'paperclip-meta'
4
4
  require 'validates_timeliness'
5
5
  require 'dynamic_form'
6
6
  require 'simple_form'
7
- require 'resque_mailer'
8
7
  require 'library_stdnums'
9
8
  require 'lisbn'
10
9
  require 'statesman'
@@ -1,3 +1,3 @@
1
1
  module EnjuBiblio
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0.beta.1"
3
3
  end
data/lib/enju_biblio.rb CHANGED
@@ -5,111 +5,4 @@ require "enju_biblio/sru"
5
5
  require "enju_biblio/biblio_helper"
6
6
 
7
7
  module EnjuBiblio
8
- def self.included(base)
9
- base.extend(ClassMethods)
10
- end
11
-
12
- module ClassMethods
13
- def enju_biblio
14
- include EnjuBiblio::InstanceMethods
15
- end
16
- end
17
-
18
- module InstanceMethods
19
- private
20
-
21
- def get_work
22
- @work = Manifestation.find(params[:work_id]) if params[:work_id]
23
- authorize! :show, @work if @work
24
- end
25
-
26
- def get_expression
27
- @expression = Manifestation.find(params[:expression_id]) if params[:expression_id]
28
- authorize! :show, @expression if @expression
29
- end
30
-
31
- def get_manifestation
32
- @manifestation = Manifestation.find(params[:manifestation_id]) if params[:manifestation_id]
33
- authorize! :show, @manifestation if @manifestation
34
- end
35
-
36
- def get_item
37
- @item = Item.find(params[:item_id]) if params[:item_id]
38
- authorize! :show, @item if @item
39
- end
40
-
41
- def get_carrier_type
42
- @carrier_type = CarrierType.find(params[:carrier_type_id]) if params[:carrier_type_id]
43
- end
44
-
45
- def get_agent
46
- @agent = Agent.find(params[:agent_id]) if params[:agent_id]
47
- authorize! :show, @agent if @agent
48
- end
49
-
50
- def get_series_statement
51
- @series_statement = SeriesStatement.find(params[:series_statement_id]) if params[:series_statement_id]
52
- end
53
-
54
- def get_basket
55
- @basket = Basket.find(params[:basket_id]) if params[:basket_id]
56
- end
57
-
58
- def get_agent_merge_list
59
- @agent_merge_list = AgentMergeList.find(params[:agent_merge_list_id]) if params[:agent_merge_list_id]
60
- end
61
-
62
- def get_series_statement_merge_list
63
- @series_statement_merge_list = SeriesStatementMergeList.find(params[:series_statement_merge_list_id]) if params[:series_statement_merge_list_id]
64
- end
65
-
66
- def make_internal_query(search)
67
- # 内部的なクエリ
68
- set_role_query(current_user, search)
69
-
70
- unless params[:mode] == "add"
71
- expression = @expression
72
- agent = @agent
73
- manifestation = @manifestation
74
- reservable = @reservable
75
- carrier_type = params[:carrier_type]
76
- library = params[:library]
77
- language = params[:language]
78
- if defined?(EnjuSubject)
79
- subject = params[:subject]
80
- subject_by_term = Subject.where(term: params[:subject]).first
81
- @subject_by_term = subject_by_term
82
- end
83
-
84
- search.build do
85
- with(:publisher_ids).equal_to agent.id if agent
86
- with(:original_manifestation_ids).equal_to manifestation.id if manifestation
87
- with(:reservable).equal_to reservable unless reservable.nil?
88
- unless carrier_type.blank?
89
- with(:carrier_type).equal_to carrier_type
90
- end
91
- unless library.blank?
92
- library_list = library.split.uniq
93
- library_list.each do |lib|
94
- with(:library).equal_to lib
95
- end
96
- end
97
- unless language.blank?
98
- language_list = language.split.uniq
99
- language_list.each do |language|
100
- with(:language).equal_to language
101
- end
102
- end
103
- if defined?(EnjuSubject)
104
- unless subject.blank?
105
- with(:subject).equal_to subject_by_term.term
106
- end
107
- end
108
- end
109
- end
110
- return search
111
- end
112
- end
113
8
  end
114
-
115
- ActionController::Base.send(:include, EnjuBiblio)
@@ -9,7 +9,7 @@ namespace :enju_biblio do
9
9
  desc "create initial records for enju_biblio"
10
10
  task :setup => :environment do
11
11
  Dir.glob(Rails.root.to_s + '/db/fixtures/enju_biblio/*.yml').each do |file|
12
- ActiveRecord::Fixtures.create_fixtures('db/fixtures/enju_biblio', File.basename(file, '.*'))
12
+ ActiveRecord::FixtureSet.create_fixtures('db/fixtures/enju_biblio', File.basename(file, '.*'))
13
13
  end
14
14
  end
15
15