enju_biblio 0.1.0.pre63 → 0.1.0.pre64

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/agent_import_files_controller.rb +9 -2
  3. data/app/controllers/agent_import_results_controller.rb +7 -0
  4. data/app/controllers/agent_merge_lists_controller.rb +7 -2
  5. data/app/controllers/agent_merges_controller.rb +7 -2
  6. data/app/controllers/agent_relationship_types_controller.rb +9 -4
  7. data/app/controllers/agent_relationships_controller.rb +8 -2
  8. data/app/controllers/agent_types_controller.rb +9 -4
  9. data/app/controllers/agents_controller.rb +15 -10
  10. data/app/controllers/carrier_types_controller.rb +14 -2
  11. data/app/controllers/content_types_controller.rb +9 -4
  12. data/app/controllers/countries_controller.rb +11 -4
  13. data/app/controllers/create_types_controller.rb +9 -4
  14. data/app/controllers/creates_controller.rb +8 -2
  15. data/app/controllers/donates_controller.rb +7 -2
  16. data/app/controllers/form_of_works_controller.rb +9 -4
  17. data/app/controllers/frequencies_controller.rb +9 -4
  18. data/app/controllers/identifier_types_controller.rb +11 -4
  19. data/app/controllers/import_requests_controller.rb +15 -2
  20. data/app/controllers/items_controller.rb +21 -3
  21. data/app/controllers/languages_controller.rb +12 -4
  22. data/app/controllers/licenses_controller.rb +9 -4
  23. data/app/controllers/manifestation_relationship_types_controller.rb +11 -4
  24. data/app/controllers/manifestation_relationships_controller.rb +8 -2
  25. data/app/controllers/manifestations_controller.rb +105 -10
  26. data/app/controllers/medium_of_performances_controller.rb +9 -4
  27. data/app/controllers/owns_controller.rb +7 -2
  28. data/app/controllers/picture_files_controller.rb +8 -2
  29. data/app/controllers/produce_types_controller.rb +9 -4
  30. data/app/controllers/produces_controller.rb +8 -2
  31. data/app/controllers/realize_types_controller.rb +11 -4
  32. data/app/controllers/realizes_controller.rb +8 -2
  33. data/app/controllers/resource_export_files_controller.rb +7 -2
  34. data/app/controllers/resource_import_files_controller.rb +9 -2
  35. data/app/controllers/resource_import_results_controller.rb +7 -0
  36. data/app/controllers/series_statement_merge_lists_controller.rb +7 -2
  37. data/app/controllers/series_statement_merges_controller.rb +9 -2
  38. data/app/controllers/series_statements_controller.rb +13 -2
  39. data/app/models/agent.rb +0 -9
  40. data/app/models/agent_import_file.rb +3 -3
  41. data/app/models/agent_import_file_transition.rb +1 -1
  42. data/app/models/agent_import_result.rb +0 -1
  43. data/app/models/agent_merge.rb +0 -1
  44. data/app/models/agent_merge_list.rb +0 -1
  45. data/app/models/agent_relationship.rb +0 -1
  46. data/app/models/agent_relationship_type.rb +0 -1
  47. data/app/models/agent_type.rb +0 -1
  48. data/app/models/carrier_type.rb +1 -7
  49. data/app/models/content_type.rb +0 -1
  50. data/app/models/country.rb +0 -1
  51. data/app/models/create.rb +0 -1
  52. data/app/models/create_type.rb +0 -1
  53. data/app/models/donate.rb +0 -1
  54. data/app/models/enju_biblio/ability.rb +25 -2
  55. data/app/models/exemplify.rb +1 -1
  56. data/app/models/form_of_work.rb +0 -1
  57. data/app/models/frequency.rb +0 -1
  58. data/app/models/identifier.rb +1 -1
  59. data/app/models/identifier_type.rb +0 -1
  60. data/app/models/import_request.rb +8 -7
  61. data/app/models/import_request_transition.rb +1 -1
  62. data/app/models/item.rb +0 -5
  63. data/app/models/language.rb +0 -2
  64. data/app/models/license.rb +0 -1
  65. data/app/models/manifestation.rb +29 -33
  66. data/app/models/manifestation_relationship.rb +0 -1
  67. data/app/models/manifestation_relationship_type.rb +0 -1
  68. data/app/models/medium_of_performance.rb +0 -1
  69. data/app/models/own.rb +0 -1
  70. data/app/models/picture_file.rb +1 -3
  71. data/app/models/produce.rb +0 -1
  72. data/app/models/produce_type.rb +0 -1
  73. data/app/models/realize.rb +0 -1
  74. data/app/models/realize_type.rb +0 -1
  75. data/app/models/resource_export_file.rb +9 -3
  76. data/app/models/resource_export_file_transition.rb +1 -1
  77. data/app/models/resource_import_file.rb +18 -10
  78. data/app/models/resource_import_file_transition.rb +1 -1
  79. data/app/models/resource_import_result.rb +0 -1
  80. data/app/models/series_statement.rb +0 -7
  81. data/app/models/series_statement_merge.rb +0 -1
  82. data/app/models/series_statement_merge_list.rb +0 -1
  83. data/app/views/items/index.html.erb +11 -0
  84. data/app/views/layouts/items.html.erb +29 -0
  85. data/app/views/manifestations/_form.html.erb +3 -3
  86. data/app/views/manifestations/_index_form_series_statement.html.erb +1 -1
  87. data/app/views/manifestations/_list.html.erb +15 -0
  88. data/app/views/manifestations/_manifestation.html.erb +59 -38
  89. data/app/views/manifestations/_pickup.html.erb +8 -0
  90. data/app/views/manifestations/_show_detail_librarian.html.erb +8 -0
  91. data/app/views/manifestations/_show_detail_user.html.erb +8 -0
  92. data/app/views/manifestations/_show_holding.html.erb +19 -0
  93. data/app/views/manifestations/_submenu_parent.html.erb +3 -0
  94. data/app/views/manifestations/index.atom.builder +3 -0
  95. data/app/views/manifestations/index.html.erb +31 -1
  96. data/app/views/manifestations/index.opds.builder +3 -0
  97. data/app/views/manifestations/show.html.erb +4 -1
  98. data/app/views/resource_export_files/index.html.erb +2 -2
  99. data/app/views/resource_export_files/show.html.erb +1 -1
  100. data/config/locales/translation_en.yml +1 -0
  101. data/config/locales/translation_ja.yml +1 -0
  102. data/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  103. data/lib/enju_biblio/biblio_helper.rb +2 -0
  104. data/lib/enju_biblio/engine.rb +0 -1
  105. data/lib/enju_biblio/version.rb +1 -1
  106. data/spec/controllers/agent_import_files_controller_spec.rb +3 -3
  107. data/spec/controllers/agent_merge_lists_controller_spec.rb +2 -2
  108. data/spec/controllers/agent_merges_controller_spec.rb +1 -1
  109. data/spec/controllers/agent_types_controller_spec.rb +8 -8
  110. data/spec/controllers/carrier_types_controller_spec.rb +8 -8
  111. data/spec/controllers/content_types_controller_spec.rb +8 -8
  112. data/spec/controllers/create_types_controller_spec.rb +6 -6
  113. data/spec/controllers/form_of_works_controller_spec.rb +6 -6
  114. data/spec/controllers/frequencies_controller_spec.rb +8 -8
  115. data/spec/controllers/identifier_types_controller_spec.rb +8 -8
  116. data/spec/controllers/licenses_controller_spec.rb +6 -6
  117. data/spec/controllers/manifestations_controller_spec.rb +22 -2
  118. data/spec/controllers/medium_of_performances_controller_spec.rb +6 -6
  119. data/spec/controllers/produce_types_controller_spec.rb +6 -6
  120. data/spec/controllers/realize_types_controller_spec.rb +6 -6
  121. data/spec/controllers/resource_export_files_controller_spec.rb +23 -23
  122. data/spec/controllers/resource_import_files_controller_spec.rb +4 -4
  123. data/spec/dummy/app/models/user.rb +0 -1
  124. data/spec/dummy/bin/bundle +3 -0
  125. data/spec/dummy/bin/rails +4 -0
  126. data/spec/dummy/bin/rake +4 -0
  127. data/spec/dummy/bin/setup +29 -0
  128. data/spec/dummy/config/application.rb +2 -2
  129. data/spec/dummy/config/boot.rb +4 -9
  130. data/spec/dummy/config/environment.rb +3 -3
  131. data/spec/dummy/db/schema.rb +118 -118
  132. data/spec/factories/manifestation.rb +8 -0
  133. data/spec/factories/series_statement.rb +5 -0
  134. data/spec/fixtures/events.yml +13 -39
  135. data/spec/fixtures/identifier_types.yml +7 -0
  136. data/spec/fixtures/identifiers.yml +7 -0
  137. data/spec/fixtures/manifestations.yml +9 -0
  138. data/spec/fixtures/use_restrictions.yml +1 -1
  139. data/spec/views/manifestations/show.html.erb_spec.rb +8 -0
  140. metadata +31 -43
  141. data/spec/dummy/db/test.sqlite3 +0 -0
  142. data/spec/dummy/script/rails +0 -6
  143. data/spec/dummy/tmp/cache/stdout +0 -25
  144. data/spec/dummy/tmp/pids/redis-test.pid +0 -1
@@ -38,11 +38,11 @@ class MediumOfPerformancesController < ApplicationController
38
38
  # POST /medium_of_performances
39
39
  # POST /medium_of_performances.json
40
40
  def create
41
- @medium_of_performance = MediumOfPerformance.new(params[:medium_of_performance])
41
+ @medium_of_performance = MediumOfPerformance.new(medium_of_performance_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @medium_of_performance.save
45
- format.html { redirect_to @medium_of_performance, notice: t('controller.successfully_created', model: t('activerecord.models.medium_of_performance')) }
45
+ format.html { redirect_to @medium_of_performance, notice: t('controller.successfully_created', model: t('activerecord.models.medium_of_performance')) }
46
46
  format.json { render json: @medium_of_performance, status: :created, location: @medium_of_performance }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class MediumOfPerformancesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @medium_of_performance.update_attributes(params[:medium_of_performance])
64
- format.html { redirect_to @medium_of_performance, notice: t('controller.successfully_updated', model: t('activerecord.models.medium_of_performance')) }
63
+ if @medium_of_performance.update_attributes(medium_of_performance_params)
64
+ format.html { redirect_to @medium_of_performance, notice: t('controller.successfully_updated', model: t('activerecord.models.medium_of_performance')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,9 @@ class MediumOfPerformancesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def medium_of_performance_params
86
+ params.require(:medium_of_performance).permit(:name, :display_name, :note)
87
+ end
83
88
  end
@@ -51,7 +51,7 @@ class OwnsController < ApplicationController
51
51
  # POST /owns
52
52
  # POST /owns.json
53
53
  def create
54
- @own = Own.new(params[:own])
54
+ @own = Own.new(own_params)
55
55
 
56
56
  respond_to do |format|
57
57
  if @own.save
@@ -74,7 +74,7 @@ class OwnsController < ApplicationController
74
74
  end
75
75
 
76
76
  respond_to do |format|
77
- if @own.update_attributes(params[:own])
77
+ if @own.update_attributes(own_params)
78
78
  format.html { redirect_to @own, notice: t('controller.successfully_updated', model: t('activerecord.models.own')) }
79
79
  format.json { head :no_content }
80
80
  else
@@ -104,4 +104,9 @@ class OwnsController < ApplicationController
104
104
  format.json { head :no_content }
105
105
  end
106
106
  end
107
+
108
+ private
109
+ def own_params
110
+ params.require(:own).permit(:agent_id, :item_id)
111
+ end
107
112
  end
@@ -75,7 +75,7 @@ class PictureFilesController < ApplicationController
75
75
  # POST /picture_files
76
76
  # POST /picture_files.json
77
77
  def create
78
- @picture_file = PictureFile.new(params[:picture_file])
78
+ @picture_file = PictureFile.new(picture_file_params)
79
79
 
80
80
  respond_to do |format|
81
81
  if @picture_file.save
@@ -114,7 +114,7 @@ class PictureFilesController < ApplicationController
114
114
  end
115
115
 
116
116
  respond_to do |format|
117
- if @picture_file.update_attributes(params[:picture_file])
117
+ if @picture_file.update_attributes(picture_file_params)
118
118
  format.html { redirect_to @picture_file, notice: t('controller.successfully_updated', model: t('activerecord.models.picture_file')) }
119
119
  format.json { head :no_content }
120
120
  else
@@ -157,6 +157,12 @@ class PictureFilesController < ApplicationController
157
157
  end
158
158
 
159
159
  private
160
+ def picture_file_params
161
+ params.require(:picture_file).permit(
162
+ :picture, :picture_attachable_id, :picture_attachable_type
163
+ )
164
+ end
165
+
160
166
  def get_attachable
161
167
  get_manifestation
162
168
  if @manifestation
@@ -38,11 +38,11 @@ class ProduceTypesController < ApplicationController
38
38
  # POST /produce_types
39
39
  # POST /produce_types.json
40
40
  def create
41
- @produce_type = ProduceType.new(params[:produce_type])
41
+ @produce_type = ProduceType.new(produce_type_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @produce_type.save
45
- format.html { redirect_to @produce_type, notice: t('controller.successfully_created', model: t('activerecord.models.produce_type')) }
45
+ format.html { redirect_to @produce_type, notice: t('controller.successfully_created', model: t('activerecord.models.produce_type')) }
46
46
  format.json { render json: @produce_type, status: :created, location: @produce_type }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class ProduceTypesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @produce_type.update_attributes(params[:produce_type])
64
- format.html { redirect_to @produce_type, notice: t('controller.successfully_updated', model: t('activerecord.models.produce_type')) }
63
+ if @produce_type.update_attributes(produce_type_params)
64
+ format.html { redirect_to @produce_type, notice: t('controller.successfully_updated', model: t('activerecord.models.produce_type')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,9 @@ class ProduceTypesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def produce_type_params
86
+ params.require(:produce_type).permit(:name, :display_name, :note, :position)
87
+ end
83
88
  end
@@ -58,7 +58,7 @@ class ProducesController < ApplicationController
58
58
  # POST /produces
59
59
  # POST /produces.json
60
60
  def create
61
- @produce = Produce.new(params[:produce])
61
+ @produce = Produce.new(produce_params)
62
62
 
63
63
  respond_to do |format|
64
64
  if @produce.save
@@ -82,7 +82,7 @@ class ProducesController < ApplicationController
82
82
  end
83
83
 
84
84
  respond_to do |format|
85
- if @produce.update_attributes(params[:produce])
85
+ if @produce.update_attributes(produce_params)
86
86
  format.html { redirect_to @produce, notice: t('controller.successfully_updated', model: t('activerecord.models.produce')) }
87
87
  format.json { head :no_content }
88
88
  else
@@ -115,6 +115,12 @@ class ProducesController < ApplicationController
115
115
  end
116
116
 
117
117
  private
118
+ def produce_params
119
+ params.require(:produce).permit(
120
+ :agent_id, :manifestation_id, :produce_type_id, :position
121
+ )
122
+ end
123
+
118
124
  def prepare_options
119
125
  @produce_types = ProduceType.all
120
126
  end
@@ -38,11 +38,11 @@ class RealizeTypesController < ApplicationController
38
38
  # POST /realize_types
39
39
  # POST /realize_types.json
40
40
  def create
41
- @realize_type = RealizeType.new(params[:realize_type])
41
+ @realize_type = RealizeType.new(realize_type_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @realize_type.save
45
- format.html { redirect_to @realize_type, notice: t('controller.successfully_created', model: t('activerecord.models.realize_type')) }
45
+ format.html { redirect_to @realize_type, notice: t('controller.successfully_created', model: t('activerecord.models.realize_type')) }
46
46
  format.json { render json: @realize_type, status: :created, location: @realize_type }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class RealizeTypesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @realize_type.update_attributes(params[:realize_type])
64
- format.html { redirect_to @realize_type, notice: t('controller.successfully_updated', model: t('activerecord.models.realize_type')) }
63
+ if @realize_type.update_attributes(realize_type_params)
64
+ format.html { redirect_to @realize_type, notice: t('controller.successfully_updated', model: t('activerecord.models.realize_type')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,11 @@ class RealizeTypesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def realize_type_params
86
+ params.require(:realize_type).permit(
87
+ :name, :display_name, :note, :position
88
+ )
89
+ end
83
90
  end
@@ -53,7 +53,7 @@ class RealizesController < ApplicationController
53
53
  # POST /realizes
54
54
  # POST /realizes.json
55
55
  def create
56
- @realize = Realize.new(params[:realize])
56
+ @realize = Realize.new(realize_params)
57
57
 
58
58
  respond_to do |format|
59
59
  if @realize.save
@@ -78,7 +78,7 @@ class RealizesController < ApplicationController
78
78
  end
79
79
 
80
80
  respond_to do |format|
81
- if @realize.update_attributes(params[:realize])
81
+ if @realize.update_attributes(realize_params)
82
82
  format.html { redirect_to @realize, notice: t('controller.successfully_updated', model: t('activerecord.models.realize')) }
83
83
  format.json { head :no_content }
84
84
  else
@@ -111,6 +111,12 @@ class RealizesController < ApplicationController
111
111
  end
112
112
 
113
113
  private
114
+ def realize_params
115
+ params.require(:realize).permit(
116
+ :agent_id, :expression_id, :realize_type_id, :position
117
+ )
118
+ end
119
+
114
120
  def prepare_options
115
121
  @realize_types = RealizeType.all
116
122
  end
@@ -53,7 +53,7 @@ class ResourceExportFilesController < ApplicationController
53
53
  # POST /resource_export_files
54
54
  # POST /resource_export_files.json
55
55
  def create
56
- @resource_export_file = ResourceExportFile.new(params[:resource_export_file])
56
+ @resource_export_file = ResourceExportFile.new(resource_export_file_params)
57
57
  @resource_export_file.user = current_user
58
58
 
59
59
  respond_to do |format|
@@ -74,7 +74,7 @@ class ResourceExportFilesController < ApplicationController
74
74
  # PUT /resource_export_files/1.json
75
75
  def update
76
76
  respond_to do |format|
77
- if @resource_export_file.update_attributes(params[:resource_export_file])
77
+ if @resource_export_file.update_attributes(resource_export_file_params)
78
78
  if @resource_export_file.mode == 'export'
79
79
  ResourceExportFileQueue.perform(@resource_export_file.id)
80
80
  end
@@ -97,4 +97,9 @@ class ResourceExportFilesController < ApplicationController
97
97
  format.json { head :no_content }
98
98
  end
99
99
  end
100
+
101
+ private
102
+ def resource_export_file_params
103
+ params.require(:resource_export_file).permit(:mode)
104
+ end
100
105
  end
@@ -55,7 +55,7 @@ class ResourceImportFilesController < ApplicationController
55
55
  # POST /resource_import_files
56
56
  # POST /resource_import_files.json
57
57
  def create
58
- @resource_import_file = ResourceImportFile.new(params[:resource_import_file])
58
+ @resource_import_file = ResourceImportFile.new(resource_import_file_params)
59
59
  @resource_import_file.user = current_user
60
60
 
61
61
  respond_to do |format|
@@ -77,7 +77,7 @@ class ResourceImportFilesController < ApplicationController
77
77
  # PUT /resource_import_files/1.json
78
78
  def update
79
79
  respond_to do |format|
80
- if @resource_import_file.update_attributes(params[:resource_import_file])
80
+ if @resource_import_file.update_attributes(resource_import_file_params)
81
81
  if @resource_import_file.mode == 'import'
82
82
  Resque.enqueue(ResourceImportFileQueue, @resource_import_file.id)
83
83
  end
@@ -103,6 +103,13 @@ class ResourceImportFilesController < ApplicationController
103
103
  end
104
104
 
105
105
  private
106
+ def resource_import_file_params
107
+ params.require(:resource_import_file).permit(
108
+ :resource_import, :edit_mode, :user_encoding, :mode,
109
+ :default_shelf_id, :library_id
110
+ )
111
+ end
112
+
106
113
  def prepare_options
107
114
  @libraries = Library.all
108
115
  library = Library.where(id: @resource_import_file.try(:library_id)).first
@@ -36,4 +36,11 @@ class ResourceImportResultsController < ApplicationController
36
36
  format.json { head :no_content }
37
37
  end
38
38
  end
39
+
40
+ private
41
+ def resource_import_result_params
42
+ params.require(:resource_import_result).permit(
43
+ :resource_import_file_id, :manifestation_id, :item_id, :body
44
+ )
45
+ end
39
46
  end
@@ -39,7 +39,7 @@ class SeriesStatementMergeListsController < ApplicationController
39
39
  # POST /series_statement_merge_lists
40
40
  # POST /series_statement_merge_lists.json
41
41
  def create
42
- @series_statement_merge_list = SeriesStatementMergeList.new(params[:series_statement_merge_list])
42
+ @series_statement_merge_list = SeriesStatementMergeList.new(series_statement_merge_list_params)
43
43
 
44
44
  respond_to do |format|
45
45
  if @series_statement_merge_list.save
@@ -57,7 +57,7 @@ class SeriesStatementMergeListsController < ApplicationController
57
57
  # PUT /series_statement_merge_lists/1.json
58
58
  def update
59
59
  respond_to do |format|
60
- if @series_statement_merge_list.update_attributes(params[:series_statement_merge_list])
60
+ if @series_statement_merge_list.update_attributes(series_statement_merge_list_params)
61
61
  if params[:mode] == 'merge'
62
62
  selected_series_statement = SeriesStatement.find(params[:selected_series_statement_id]) rescue nil
63
63
  if selected_series_statement
@@ -89,4 +89,9 @@ class SeriesStatementMergeListsController < ApplicationController
89
89
  format.json { head :no_content }
90
90
  end
91
91
  end
92
+
93
+ private
94
+ def series_statement_merge_list_params
95
+ params.require(:series_statement_merge_list).permit(:title)
96
+ end
92
97
  end
@@ -48,7 +48,7 @@ class SeriesStatementMergesController < ApplicationController
48
48
  # POST /series_statement_merges
49
49
  # POST /series_statement_merges.json
50
50
  def create
51
- @series_statement_merge = SeriesStatementMerge.new(params[:series_statement_merge])
51
+ @series_statement_merge = SeriesStatementMerge.new(series_statement_merge_params)
52
52
 
53
53
  respond_to do |format|
54
54
  if @series_statement_merge.save
@@ -66,7 +66,7 @@ class SeriesStatementMergesController < ApplicationController
66
66
  # PUT /series_statement_merges/1.json
67
67
  def update
68
68
  respond_to do |format|
69
- if @series_statement_merge.update_attributes(params[:series_statement_merge])
69
+ if @series_statement_merge.update_attributes(series_statement_merge_params)
70
70
  flash[:notice] = t('controller.successfully_updated', model: t('activerecord.models.series_statement_merge'))
71
71
  format.html { redirect_to(@series_statement_merge) }
72
72
  format.json { head :no_content }
@@ -87,4 +87,11 @@ class SeriesStatementMergesController < ApplicationController
87
87
  format.json { head :no_content }
88
88
  end
89
89
  end
90
+
91
+ private
92
+ def series_statement_merge_params
93
+ params.require(:series_statement_merge).permit(
94
+ :series_statement_id, :series_statement_merge_list_id
95
+ )
96
+ end
90
97
  end
@@ -68,7 +68,7 @@ class SeriesStatementsController < ApplicationController
68
68
  # POST /series_statements
69
69
  # POST /series_statements.json
70
70
  def create
71
- @series_statement = SeriesStatement.new(params[:series_statement])
71
+ @series_statement = SeriesStatement.new(series_statement_params)
72
72
  manifestation = Manifestation.find(@series_statement.manifestation_id) rescue nil
73
73
 
74
74
  respond_to do |format|
@@ -93,7 +93,7 @@ class SeriesStatementsController < ApplicationController
93
93
  end
94
94
 
95
95
  respond_to do |format|
96
- if @series_statement.update_attributes(params[:series_statement])
96
+ if @series_statement.update_attributes(series_statement_params)
97
97
  format.html { redirect_to @series_statement, notice: t('controller.successfully_updated', model: t('activerecord.models.series_statement')) }
98
98
  format.json { head :no_content }
99
99
  else
@@ -114,4 +114,15 @@ class SeriesStatementsController < ApplicationController
114
114
  format.json { head :no_content }
115
115
  end
116
116
  end
117
+
118
+ private
119
+ def series_statement_params
120
+ params.require(:series_statement).permit(
121
+ :original_title, :numbering, :title_subseries,:numbering_subseries,
122
+ :title_transcription, :title_alternative, :series_statement_identifier,
123
+ :note, :root_manifestation_id, :url,
124
+ :title_subseries_transcription, :creator_string, :volume_number_string,
125
+ :series_master
126
+ )
127
+ end
117
128
  end
data/app/models/agent.rb CHANGED
@@ -1,14 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  class Agent < ActiveRecord::Base
3
- attr_accessible :last_name, :middle_name, :first_name,
4
- :last_name_transcription, :middle_name_transcription,
5
- :first_name_transcription, :corporate_name, :corporate_name_transcription,
6
- :full_name, :full_name_transcription, :full_name_alternative,
7
- :other_designation, :language_id,
8
- :country_id, :agent_type_id, :note, :required_role_id, :email, :url,
9
- :full_name_alternative_transcription, :title,
10
- :agent_identifier
11
-
12
3
  scope :readable_by, lambda{ |user|
13
4
  if user
14
5
  where('required_role_id <= ?', user.try(:user_has_role).try(:role_id))
@@ -1,13 +1,13 @@
1
1
  class AgentImportFile < ActiveRecord::Base
2
- include Statesman::Adapters::ActiveRecordModel
2
+ include Statesman::Adapters::ActiveRecordQueries
3
3
  include ImportFile
4
- attr_accessible :agent_import, :edit_mode, :user_encoding, :mode
5
4
  default_scope { order('agent_import_files.id DESC') }
6
5
  scope :not_imported, -> { in_state(:pending) }
7
6
  scope :stucked, -> { in_state(:pending).where('agent_import_files.created_at < ?', 1.hour.ago) }
8
7
 
9
8
  if Setting.uploaded_file.storage == :s3
10
- has_attached_file :agent_import, storage: :s3, s3_credentials: "#{Setting.amazon}",
9
+ has_attached_file :agent_import, storage: :s3,
10
+ s3_credentials: Setting.amazon,
11
11
  s3_permissions: :private
12
12
  else
13
13
  has_attached_file :agent_import,
@@ -3,7 +3,7 @@ class AgentImportFileTransition < ActiveRecord::Base
3
3
 
4
4
 
5
5
  belongs_to :agent_import_file, inverse_of: :agent_import_file_transitions
6
- attr_accessible :to_state, :sort_key, :metadata
6
+ #attr_accessible :to_state, :sort_key, :metadata
7
7
  end
8
8
 
9
9
  # == Schema Information
@@ -1,5 +1,4 @@
1
1
  class AgentImportResult < ActiveRecord::Base
2
- attr_accessible :agent_import_file_id, :agent_id, :body
3
2
  default_scope { order('agent_import_results.id') }
4
3
  scope :file_id, proc{|file_id| where(agent_import_file_id: file_id)}
5
4
  scope :failed, -> { where(agent_id: nil) }
@@ -1,5 +1,4 @@
1
1
  class AgentMerge < ActiveRecord::Base
2
- attr_accessible :agent_id, :agent_merge_list_id
3
2
  belongs_to :agent, validate: true
4
3
  belongs_to :agent_merge_list, validate: true
5
4
  validates_presence_of :agent, :agent_merge_list