Skip to content
Snippets Groups Projects
Commit 4ee03458 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

Merge branch 'curator' into 'master'

Curator

See merge request !419
parents c64cc183 e5647d67
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ class LearningObjectBuilder ...@@ -7,6 +7,7 @@ class LearningObjectBuilder
metadata: dspace_metadata_to_hash(item.metadata) metadata: dspace_metadata_to_hash(item.metadata)
) )
lo.curator = lo.get_metadata_value_of('dc.curator')
institution = lo.get_metadata_value_of('dc.creator') institution = lo.get_metadata_value_of('dc.creator')
institution = 'Desconhecido' if institution.blank? institution = 'Desconhecido' if institution.blank?
lo.publisher = Institution.where(name: institution).first_or_create lo.publisher = Institution.where(name: institution).first_or_create
......
...@@ -94,7 +94,7 @@ class V1::LearningObjectsController < ApplicationController ...@@ -94,7 +94,7 @@ class V1::LearningObjectsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.
def learning_object_params def learning_object_params
return nil if params[:learning_object].nil? return nil if params[:learning_object].nil?
params[:learning_object].permit(:author, :name, :object_type_id, :description, :license_id, :thumbnail, :software, :language_id, :link) params[:learning_object].permit(:author, :name, :curator, :object_type_id, :description, :license_id, :thumbnail, :software, :language_id, :link)
end end
def extra_params def extra_params
......
...@@ -34,6 +34,7 @@ class LearningObjectSerializer < ActiveModel::Serializer ...@@ -34,6 +34,7 @@ class LearningObjectSerializer < ActiveModel::Serializer
:name, :name,
:description, :description,
:author, :author,
:curator,
:thumbnail, :thumbnail,
:object_type, :object_type,
:language, :language,
......
...@@ -68,7 +68,8 @@ class LearningObjectPublisher ...@@ -68,7 +68,8 @@ class LearningObjectPublisher
'dc.type' => object.object_type.try(:name), 'dc.type' => object.object_type.try(:name),
'dc.rights.license' => object.license.try(:name), 'dc.rights.license' => object.license.try(:name),
# 'dc.subject.category' => object.subjects, # 'dc.subject.category' => object.subjects,
'dc.date.submitted' => object.created_at.to_s 'dc.date.submitted' => object.created_at.to_s,
'dc.curator' => object.curator
} }
end end
end end
class AddCuratorToLearningObject < ActiveRecord::Migration[5.0]
def change
add_column :learning_objects, :curator, :string
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment