Skip to content
Snippets Groups Projects
Commit 2cb84884 authored by Clarissa's avatar Clarissa
Browse files

Merge branch 'master' of gitlab.c3sl.ufpr.br:portalmec/portalmec

parents 1a7d2130 4ee03458
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ class LearningObjectBuilder
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 = 'Desconhecido' if institution.blank?
lo.publisher = Institution.where(name: institution).first_or_create
......
......@@ -94,7 +94,7 @@ class V1::LearningObjectsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def learning_object_params
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
def extra_params
......
......@@ -34,6 +34,7 @@ class LearningObjectSerializer < ActiveModel::Serializer
:name,
:description,
:author,
:curator,
:thumbnail,
:object_type,
:language,
......
......@@ -68,7 +68,8 @@ class LearningObjectPublisher
'dc.type' => object.object_type.try(:name),
'dc.rights.license' => object.license.try(:name),
# '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
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