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.
- checksums.yaml +4 -4
- data/app/controllers/agent_import_files_controller.rb +9 -2
- data/app/controllers/agent_import_results_controller.rb +7 -0
- data/app/controllers/agent_merge_lists_controller.rb +7 -2
- data/app/controllers/agent_merges_controller.rb +7 -2
- data/app/controllers/agent_relationship_types_controller.rb +9 -4
- data/app/controllers/agent_relationships_controller.rb +8 -2
- data/app/controllers/agent_types_controller.rb +9 -4
- data/app/controllers/agents_controller.rb +15 -10
- data/app/controllers/carrier_types_controller.rb +14 -2
- data/app/controllers/content_types_controller.rb +9 -4
- data/app/controllers/countries_controller.rb +11 -4
- data/app/controllers/create_types_controller.rb +9 -4
- data/app/controllers/creates_controller.rb +8 -2
- data/app/controllers/donates_controller.rb +7 -2
- data/app/controllers/form_of_works_controller.rb +9 -4
- data/app/controllers/frequencies_controller.rb +9 -4
- data/app/controllers/identifier_types_controller.rb +11 -4
- data/app/controllers/import_requests_controller.rb +15 -2
- data/app/controllers/items_controller.rb +21 -3
- data/app/controllers/languages_controller.rb +12 -4
- data/app/controllers/licenses_controller.rb +9 -4
- data/app/controllers/manifestation_relationship_types_controller.rb +11 -4
- data/app/controllers/manifestation_relationships_controller.rb +8 -2
- data/app/controllers/manifestations_controller.rb +105 -10
- data/app/controllers/medium_of_performances_controller.rb +9 -4
- data/app/controllers/owns_controller.rb +7 -2
- data/app/controllers/picture_files_controller.rb +8 -2
- data/app/controllers/produce_types_controller.rb +9 -4
- data/app/controllers/produces_controller.rb +8 -2
- data/app/controllers/realize_types_controller.rb +11 -4
- data/app/controllers/realizes_controller.rb +8 -2
- data/app/controllers/resource_export_files_controller.rb +7 -2
- data/app/controllers/resource_import_files_controller.rb +9 -2
- data/app/controllers/resource_import_results_controller.rb +7 -0
- data/app/controllers/series_statement_merge_lists_controller.rb +7 -2
- data/app/controllers/series_statement_merges_controller.rb +9 -2
- data/app/controllers/series_statements_controller.rb +13 -2
- data/app/models/agent.rb +0 -9
- data/app/models/agent_import_file.rb +3 -3
- data/app/models/agent_import_file_transition.rb +1 -1
- data/app/models/agent_import_result.rb +0 -1
- data/app/models/agent_merge.rb +0 -1
- data/app/models/agent_merge_list.rb +0 -1
- data/app/models/agent_relationship.rb +0 -1
- data/app/models/agent_relationship_type.rb +0 -1
- data/app/models/agent_type.rb +0 -1
- data/app/models/carrier_type.rb +1 -7
- data/app/models/content_type.rb +0 -1
- data/app/models/country.rb +0 -1
- data/app/models/create.rb +0 -1
- data/app/models/create_type.rb +0 -1
- data/app/models/donate.rb +0 -1
- data/app/models/enju_biblio/ability.rb +25 -2
- data/app/models/exemplify.rb +1 -1
- data/app/models/form_of_work.rb +0 -1
- data/app/models/frequency.rb +0 -1
- data/app/models/identifier.rb +1 -1
- data/app/models/identifier_type.rb +0 -1
- data/app/models/import_request.rb +8 -7
- data/app/models/import_request_transition.rb +1 -1
- data/app/models/item.rb +0 -5
- data/app/models/language.rb +0 -2
- data/app/models/license.rb +0 -1
- data/app/models/manifestation.rb +29 -33
- data/app/models/manifestation_relationship.rb +0 -1
- data/app/models/manifestation_relationship_type.rb +0 -1
- data/app/models/medium_of_performance.rb +0 -1
- data/app/models/own.rb +0 -1
- data/app/models/picture_file.rb +1 -3
- data/app/models/produce.rb +0 -1
- data/app/models/produce_type.rb +0 -1
- data/app/models/realize.rb +0 -1
- data/app/models/realize_type.rb +0 -1
- data/app/models/resource_export_file.rb +9 -3
- data/app/models/resource_export_file_transition.rb +1 -1
- data/app/models/resource_import_file.rb +18 -10
- data/app/models/resource_import_file_transition.rb +1 -1
- data/app/models/resource_import_result.rb +0 -1
- data/app/models/series_statement.rb +0 -7
- data/app/models/series_statement_merge.rb +0 -1
- data/app/models/series_statement_merge_list.rb +0 -1
- data/app/views/items/index.html.erb +11 -0
- data/app/views/layouts/items.html.erb +29 -0
- data/app/views/manifestations/_form.html.erb +3 -3
- data/app/views/manifestations/_index_form_series_statement.html.erb +1 -1
- data/app/views/manifestations/_list.html.erb +15 -0
- data/app/views/manifestations/_manifestation.html.erb +59 -38
- data/app/views/manifestations/_pickup.html.erb +8 -0
- data/app/views/manifestations/_show_detail_librarian.html.erb +8 -0
- data/app/views/manifestations/_show_detail_user.html.erb +8 -0
- data/app/views/manifestations/_show_holding.html.erb +19 -0
- data/app/views/manifestations/_submenu_parent.html.erb +3 -0
- data/app/views/manifestations/index.atom.builder +3 -0
- data/app/views/manifestations/index.html.erb +31 -1
- data/app/views/manifestations/index.opds.builder +3 -0
- data/app/views/manifestations/show.html.erb +4 -1
- data/app/views/resource_export_files/index.html.erb +2 -2
- data/app/views/resource_export_files/show.html.erb +1 -1
- data/config/locales/translation_en.yml +1 -0
- data/config/locales/translation_ja.yml +1 -0
- data/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +2 -0
- data/lib/enju_biblio/engine.rb +0 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/controllers/agent_import_files_controller_spec.rb +3 -3
- data/spec/controllers/agent_merge_lists_controller_spec.rb +2 -2
- data/spec/controllers/agent_merges_controller_spec.rb +1 -1
- data/spec/controllers/agent_types_controller_spec.rb +8 -8
- data/spec/controllers/carrier_types_controller_spec.rb +8 -8
- data/spec/controllers/content_types_controller_spec.rb +8 -8
- data/spec/controllers/create_types_controller_spec.rb +6 -6
- data/spec/controllers/form_of_works_controller_spec.rb +6 -6
- data/spec/controllers/frequencies_controller_spec.rb +8 -8
- data/spec/controllers/identifier_types_controller_spec.rb +8 -8
- data/spec/controllers/licenses_controller_spec.rb +6 -6
- data/spec/controllers/manifestations_controller_spec.rb +22 -2
- data/spec/controllers/medium_of_performances_controller_spec.rb +6 -6
- data/spec/controllers/produce_types_controller_spec.rb +6 -6
- data/spec/controllers/realize_types_controller_spec.rb +6 -6
- data/spec/controllers/resource_export_files_controller_spec.rb +23 -23
- data/spec/controllers/resource_import_files_controller_spec.rb +4 -4
- data/spec/dummy/app/models/user.rb +0 -1
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +2 -2
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/environment.rb +3 -3
- data/spec/dummy/db/schema.rb +118 -118
- data/spec/factories/manifestation.rb +8 -0
- data/spec/factories/series_statement.rb +5 -0
- data/spec/fixtures/events.yml +13 -39
- data/spec/fixtures/identifier_types.yml +7 -0
- data/spec/fixtures/identifiers.yml +7 -0
- data/spec/fixtures/manifestations.yml +9 -0
- data/spec/fixtures/use_restrictions.yml +1 -1
- data/spec/views/manifestations/show.html.erb_spec.rb +8 -0
- metadata +31 -43
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/tmp/cache/stdout +0 -25
- 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(
|
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:
|
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(
|
64
|
-
format.html { redirect_to @medium_of_performance, notice:
|
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(
|
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(
|
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(
|
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(
|
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(
|
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:
|
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(
|
64
|
-
format.html { redirect_to @produce_type, notice:
|
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(
|
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(
|
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(
|
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:
|
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(
|
64
|
-
format.html { redirect_to @realize_type, notice:
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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::
|
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,
|
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,
|