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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12c3398286d119f0c1da75ab93a49e47b05d3332
4
- data.tar.gz: ca673d38b8c33ebb9b91e836af956ae45209970a
3
+ metadata.gz: 84f441b00ab4993e30a148f4586a3df9b3f6a7c7
4
+ data.tar.gz: 9bed5a638d31eee0f50ba95607f63814efb6f14c
5
5
  SHA512:
6
- metadata.gz: 92c2e3f791d543aaa1060db69a01bc9ec4253875bb1ec865d890d1e2b3dec6e731218670a9d036c1c0fee62bc56a17f7fe962b96174ebd893f77a31a668cc2dd
7
- data.tar.gz: 0402d031655a3fb8212b763ff37b305f179cb5a836b7a2f63cc6840a035693f903fb15c4ba0b24387e197bbabe0bd9554cdf5cf6736d090f78fc44e448070777
6
+ metadata.gz: 44a827b4622c2e70a28852b7a66ab287d56ba367354b4d7fba8cbda18f9e734b724dacb43e32fcc2cbdcfc0dde30c85fae945d2fdc900306bd0129ba5914d042
7
+ data.tar.gz: 6fc8700461ee0c88c84c79c9a713b838a40ab68e0a17cc2377a9a36a2d122e48df7145650ed059cd4aef9d84bd2d4a1901c0edbeb8e9619569fbc7b7e4ba90e0
@@ -52,7 +52,7 @@ class AgentImportFilesController < ApplicationController
52
52
  # POST /agent_import_files
53
53
  # POST /agent_import_files.json
54
54
  def create
55
- @agent_import_file = AgentImportFile.new(params[:agent_import_file])
55
+ @agent_import_file = AgentImportFile.new(agent_import_file_params)
56
56
  @agent_import_file.user = current_user
57
57
 
58
58
  respond_to do |format|
@@ -73,7 +73,7 @@ class AgentImportFilesController < ApplicationController
73
73
  # PUT /agent_import_files/1.json
74
74
  def update
75
75
  respond_to do |format|
76
- if @agent_import_file.update_attributes(params[:agent_import_file])
76
+ if @agent_import_file.update_attributes(agent_import_file_params)
77
77
  if @agent_import_file.mode == 'import'
78
78
  Resque.enqueue(AgentImportFileQueue, @agent_import_file.id)
79
79
  end
@@ -96,4 +96,11 @@ class AgentImportFilesController < ApplicationController
96
96
  format.json { head :no_content }
97
97
  end
98
98
  end
99
+
100
+ private
101
+ def agent_import_file_params
102
+ params.require(:agent_import_file).permit(
103
+ :agent_import, :edit_mode, :user_encoding, :mode
104
+ )
105
+ end
99
106
  end
@@ -36,4 +36,11 @@ class AgentImportResultsController < ApplicationController
36
36
  format.json { head :no_content }
37
37
  end
38
38
  end
39
+
40
+ private
41
+ def agent_import_result_params
42
+ params.require(:agent_import_result).permit(
43
+ :agent_import_file_id, :agent_id, :body
44
+ )
45
+ end
39
46
  end
@@ -39,7 +39,7 @@ class AgentMergeListsController < ApplicationController
39
39
  # POST /agent_merge_lists
40
40
  # POST /agent_merge_lists.json
41
41
  def create
42
- @agent_merge_list = AgentMergeList.new(params[:agent_merge_list])
42
+ @agent_merge_list = AgentMergeList.new(agent_merge_list_params)
43
43
 
44
44
  respond_to do |format|
45
45
  if @agent_merge_list.save
@@ -57,7 +57,7 @@ class AgentMergeListsController < ApplicationController
57
57
  # PUT /agent_merge_lists/1.json
58
58
  def update
59
59
  respond_to do |format|
60
- if @agent_merge_list.update_attributes(params[:agent_merge_list])
60
+ if @agent_merge_list.update_attributes(agent_merge_list_params)
61
61
  if params[:mode] == 'merge'
62
62
  selected_agent = Agent.where(id: params[:selected_agent_id]).first
63
63
  if selected_agent
@@ -90,4 +90,9 @@ class AgentMergeListsController < ApplicationController
90
90
  format.json { head :no_content }
91
91
  end
92
92
  end
93
+
94
+ private
95
+ def agent_merge_list_params
96
+ params.fetch(:agent_merge_list, {}).permit(:title)
97
+ end
93
98
  end
@@ -47,7 +47,7 @@ class AgentMergesController < ApplicationController
47
47
  # POST /agent_merges
48
48
  # POST /agent_merges.json
49
49
  def create
50
- @agent_merge = AgentMerge.new(params[:agent_merge])
50
+ @agent_merge = AgentMerge.new(agent_merge_params)
51
51
 
52
52
  respond_to do |format|
53
53
  if @agent_merge.save
@@ -64,7 +64,7 @@ class AgentMergesController < ApplicationController
64
64
  # PUT /agent_merges/1.json
65
65
  def update
66
66
  respond_to do |format|
67
- if @agent_merge.update_attributes(params[:agent_merge])
67
+ if @agent_merge.update_attributes(agent_merge_params)
68
68
  format.html { redirect_to(@agent_merge, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_merge'))) }
69
69
  format.json { head :no_content }
70
70
  else
@@ -84,4 +84,9 @@ class AgentMergesController < ApplicationController
84
84
  format.json { head :no_content }
85
85
  end
86
86
  end
87
+
88
+ private
89
+ def agent_merge_params
90
+ params.require(:agent_merge).permit(:agent_id, :agent_merge_list_id)
91
+ end
87
92
  end
@@ -38,11 +38,11 @@ class AgentRelationshipTypesController < ApplicationController
38
38
  # POST /agent_relationship_types
39
39
  # POST /agent_relationship_types.json
40
40
  def create
41
- @agent_relationship_type = AgentRelationshipType.new(params[:agent_relationship_type])
41
+ @agent_relationship_type = AgentRelationshipType.new(agent_relationship_type_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @agent_relationship_type.save
45
- format.html { redirect_to @agent_relationship_type, notice: t('controller.successfully_created', model: t('activerecord.models.agent_relationship_type')) }
45
+ format.html { redirect_to @agent_relationship_type, notice: t('controller.successfully_created', model: t('activerecord.models.agent_relationship_type')) }
46
46
  format.json { render json: @agent_relationship_type, status: :created, location: @agent_relationship_type }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class AgentRelationshipTypesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @agent_relationship_type.update_attributes(params[:agent_relationship_type])
64
- format.html { redirect_to @agent_relationship_type, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_relationship_type')) }
63
+ if @agent_relationship_type.update_attributes(agent_relationship_type_params)
64
+ format.html { redirect_to @agent_relationship_type, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_relationship_type')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,9 @@ class AgentRelationshipTypesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def agent_relationship_type_params
86
+ params.require(:agent_relationship_type).permit(:name, :display_name, :note)
87
+ end
83
88
  end
@@ -47,7 +47,7 @@ class AgentRelationshipsController < ApplicationController
47
47
  # POST /agent_relationships
48
48
  # POST /agent_relationships.json
49
49
  def create
50
- @agent_relationship = AgentRelationship.new(params[:agent_relationship])
50
+ @agent_relationship = AgentRelationship.new(agent_relationship_params)
51
51
 
52
52
  respond_to do |format|
53
53
  if @agent_relationship.save
@@ -72,7 +72,7 @@ class AgentRelationshipsController < ApplicationController
72
72
  end
73
73
 
74
74
  respond_to do |format|
75
- if @agent_relationship.update_attributes(params[:agent_relationship])
75
+ if @agent_relationship.update_attributes(agent_relationship_params)
76
76
  format.html { redirect_to @agent_relationship, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_relationship')) }
77
77
  format.json { head :no_content }
78
78
  else
@@ -102,6 +102,12 @@ class AgentRelationshipsController < ApplicationController
102
102
  end
103
103
 
104
104
  private
105
+ def agent_relationship_params
106
+ params.require(:agent_relationship).permit(
107
+ :parent_id, :child_id, :agent_relationship_type_id
108
+ )
109
+ end
110
+
105
111
  def prepare_options
106
112
  @agent_relationship_types = AgentRelationshipType.all
107
113
  end
@@ -38,11 +38,11 @@ class AgentTypesController < ApplicationController
38
38
  # POST /agent_types
39
39
  # POST /agent_types.json
40
40
  def create
41
- @agent_type = AgentType.new(params[:agent_type])
41
+ @agent_type = AgentType.new(agent_type_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @agent_type.save
45
- format.html { redirect_to @agent_type, notice: t('controller.successfully_created', model: t('activerecord.models.agent_type')) }
45
+ format.html { redirect_to @agent_type, notice: t('controller.successfully_created', model: t('activerecord.models.agent_type')) }
46
46
  format.json { render json: @agent_type, status: :created, location: @agent_type }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class AgentTypesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @agent_type.update_attributes(params[:agent_type])
64
- format.html { redirect_to @agent_type, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_type')) }
63
+ if @agent_type.update_attributes(agent_type_params)
64
+ format.html { redirect_to @agent_type, notice: t('controller.successfully_updated', model: t('activerecord.models.agent_type')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,9 @@ class AgentTypesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def agent_type_params
86
+ params.require(:agent_type).permit(:name, :display_name, :note)
87
+ end
83
88
  end
@@ -152,15 +152,7 @@ class AgentsController < ApplicationController
152
152
  # POST /agents
153
153
  # POST /agents.json
154
154
  def create
155
- @agent = Agent.new(params[:agent])
156
- #if @agent.user_username
157
- # @agent.user = User.find(@agent.user_username) rescue nil
158
- #end
159
- #unless current_user.has_role?('Librarian')
160
- # if @agent.user != current_user
161
- # access_denied; return
162
- # end
163
- #end
155
+ @agent = Agent.new(agent_params)
164
156
 
165
157
  respond_to do |format|
166
158
  if @agent.save
@@ -186,7 +178,7 @@ class AgentsController < ApplicationController
186
178
  # PUT /agents/1.json
187
179
  def update
188
180
  respond_to do |format|
189
- if @agent.update_attributes(params[:agent])
181
+ if @agent.update_attributes(agent_params)
190
182
  format.html { redirect_to @agent, notice: t('controller.successfully_updated', model: t('activerecord.models.agent')) }
191
183
  format.json { head :no_content }
192
184
  else
@@ -209,6 +201,19 @@ class AgentsController < ApplicationController
209
201
  end
210
202
 
211
203
  private
204
+ def agent_params
205
+ params.require(:agent).permit(
206
+ :last_name, :middle_name, :first_name,
207
+ :last_name_transcription, :middle_name_transcription,
208
+ :first_name_transcription, :corporate_name, :corporate_name_transcription,
209
+ :full_name, :full_name_transcription, :full_name_alternative,
210
+ :other_designation, :language_id,
211
+ :country_id, :agent_type_id, :note, :required_role_id, :email, :url,
212
+ :full_name_alternative_transcription, :title,
213
+ :agent_identifier
214
+ )
215
+ end
216
+
212
217
  def prepare_options
213
218
  @countries = Country.all_cache
214
219
  @agent_types = AgentType.all
@@ -40,7 +40,7 @@ class CarrierTypesController < ApplicationController
40
40
  # POST /carrier_types
41
41
  # POST /carrier_types.json
42
42
  def create
43
- @carrier_type = CarrierType.new(params[:carrier_type])
43
+ @carrier_type = CarrierType.new(carrier_type_params)
44
44
 
45
45
  respond_to do |format|
46
46
  if @carrier_type.save
@@ -63,7 +63,7 @@ class CarrierTypesController < ApplicationController
63
63
  end
64
64
 
65
65
  respond_to do |format|
66
- if @carrier_type.update_attributes(params[:carrier_type])
66
+ if @carrier_type.update_attributes(carrier_type_params)
67
67
  format.html { redirect_to @carrier_type, notice: t('controller.successfully_updated', model: t('activerecord.models.carrier_type')) }
68
68
  format.json { head :no_content }
69
69
  else
@@ -86,6 +86,18 @@ class CarrierTypesController < ApplicationController
86
86
  end
87
87
 
88
88
  private
89
+ def carrier_type_params
90
+ params.require(:carrier_type).permit(
91
+ :name, :display_name, :note, :position,
92
+ # EnjuCirculation
93
+ {
94
+ :carrier_type_has_checkout_types_attributes => [
95
+ :id, :checkout_type_id, :_destroy
96
+ ]
97
+ }
98
+ )
99
+ end
100
+
89
101
  def prepare_options
90
102
  if defined?(EnjuCirculation)
91
103
  @checkout_types = CheckoutType.select([:id, :display_name, :position])
@@ -38,11 +38,11 @@ class ContentTypesController < ApplicationController
38
38
  # POST /content_types
39
39
  # POST /content_types.json
40
40
  def create
41
- @content_type = ContentType.new(params[:content_type])
41
+ @content_type = ContentType.new(content_type_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @content_type.save
45
- format.html { redirect_to @content_type, notice: t('controller.successfully_created', model: t('activerecord.models.content_type')) }
45
+ format.html { redirect_to @content_type, notice: t('controller.successfully_created', model: t('activerecord.models.content_type')) }
46
46
  format.json { render json: @content_type, status: :created, location: @content_type }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class ContentTypesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @content_type.update_attributes(params[:content_type])
64
- format.html { redirect_to @content_type, notice: t('controller.successfully_updated', model: t('activerecord.models.content_type')) }
63
+ if @content_type.update_attributes(content_type_params)
64
+ format.html { redirect_to @content_type, notice: t('controller.successfully_updated', model: t('activerecord.models.content_type')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,9 @@ class ContentTypesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def content_type_params
86
+ params.require(:content_type).permit(:name, :display_name, :note)
87
+ end
83
88
  end
@@ -38,11 +38,11 @@ class CountriesController < ApplicationController
38
38
  # POST /countries
39
39
  # POST /countries.json
40
40
  def create
41
- @country = Country.new(params[:country])
41
+ @country = Country.new(country_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @country.save
45
- format.html { redirect_to @country, notice: t('controller.successfully_created', model: t('activerecord.models.country')) }
45
+ format.html { redirect_to @country, notice: t('controller.successfully_created', model: t('activerecord.models.country')) }
46
46
  format.json { render json: @country, status: :created, location: @country }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class CountriesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @country.update_attributes(params[:country])
64
- format.html { redirect_to @country, notice: t('controller.successfully_updated', model: t('activerecord.models.country')) }
63
+ if @country.update_attributes(country_params)
64
+ format.html { redirect_to @country, notice: t('controller.successfully_updated', model: t('activerecord.models.country')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,11 @@ class CountriesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def country_params
86
+ params.require(:country).permit(
87
+ :name, :display_name, :alpha_2, :alpha_3, :numeric_3, :note
88
+ )
89
+ end
83
90
  end
@@ -38,11 +38,11 @@ class CreateTypesController < ApplicationController
38
38
  # POST /create_types
39
39
  # POST /create_types.json
40
40
  def create
41
- @create_type = CreateType.new(params[:create_type])
41
+ @create_type = CreateType.new(create_type_params)
42
42
 
43
43
  respond_to do |format|
44
44
  if @create_type.save
45
- format.html { redirect_to @create_type, notice: t('controller.successfully_created', model: t('activerecord.models.create_type')) }
45
+ format.html { redirect_to @create_type, notice: t('controller.successfully_created', model: t('activerecord.models.create_type')) }
46
46
  format.json { render json: @create_type, status: :created, location: @create_type }
47
47
  else
48
48
  format.html { render action: "new" }
@@ -60,8 +60,8 @@ class CreateTypesController < ApplicationController
60
60
  end
61
61
 
62
62
  respond_to do |format|
63
- if @create_type.update_attributes(params[:create_type])
64
- format.html { redirect_to @create_type, notice: t('controller.successfully_updated', model: t('activerecord.models.create_type')) }
63
+ if @create_type.update_attributes(create_type_params)
64
+ format.html { redirect_to @create_type, notice: t('controller.successfully_updated', model: t('activerecord.models.create_type')) }
65
65
  format.json { head :no_content }
66
66
  else
67
67
  format.html { render action: "edit" }
@@ -80,4 +80,9 @@ class CreateTypesController < ApplicationController
80
80
  format.json { head :no_content }
81
81
  end
82
82
  end
83
+
84
+ private
85
+ def create_type_params
86
+ params.require(:create_type).permit(:name, :display_name, :note, :position)
87
+ end
83
88
  end
@@ -53,7 +53,7 @@ class CreatesController < ApplicationController
53
53
  # POST /creates
54
54
  # POST /creates.json
55
55
  def create
56
- @create = Create.new(params[:create])
56
+ @create = Create.new(create_params)
57
57
 
58
58
  respond_to do |format|
59
59
  if @create.save
@@ -78,7 +78,7 @@ class CreatesController < ApplicationController
78
78
  end
79
79
 
80
80
  respond_to do |format|
81
- if @create.update_attributes(params[:create])
81
+ if @create.update_attributes(create_params)
82
82
  format.html { redirect_to @create, notice: t('controller.successfully_updated', model: t('activerecord.models.create')) }
83
83
  format.json { head :no_content }
84
84
  else
@@ -111,6 +111,12 @@ class CreatesController < ApplicationController
111
111
  end
112
112
 
113
113
  private
114
+ def create_params
115
+ params.require(:create).permit(
116
+ :agent_id, :work_id, :create_type_id, :position
117
+ )
118
+ end
119
+
114
120
  def prepare_options
115
121
  @create_types = CreateType.all
116
122
  end
@@ -39,7 +39,7 @@ class DonatesController < ApplicationController
39
39
  # POST /donates
40
40
  # POST /donates.json
41
41
  def create
42
- @donate = Donate.new(params[:donate])
42
+ @donate = Donate.new(donate_params)
43
43
 
44
44
  respond_to do |format|
45
45
  if @donate.save
@@ -56,7 +56,7 @@ class DonatesController < ApplicationController
56
56
  # PUT /donates/1.json
57
57
  def update
58
58
  respond_to do |format|
59
- if @donate.update_attributes(params[:donate])
59
+ if @donate.update_attributes(donate_params)
60
60
  format.html { redirect_to @donate, notice: t('controller.successfully_updated', model: t('activerecord.models.donate')) }
61
61
  format.json { head :no_content }
62
62
  else
@@ -76,4 +76,9 @@ class DonatesController < ApplicationController
76
76
  format.json { head :no_content }
77
77
  end
78
78
  end
79
+
80
+ private
81
+ def donate_params
82
+ params.require(:donate).permit(:agent_id, :item_id)
83
+ end
79
84
  end