Skip to content

Commit

Permalink
Set licence_url from licence using licences service
Browse files Browse the repository at this point in the history
Set the licence_url from the licence if the licence_url
is not set (and if the licence_url can be mapped). Uses
the Hyrax Licences service and the configuration used
to power to front end webform.

Required by CottageLabs#2
  • Loading branch information
tomwrobel committed May 6, 2021
1 parent e43a3c9 commit 8d09c16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/services/willow_sword/assign_mets_to_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,12 @@ def assign_record_info
info_note_fields.each do |data_fld, model_fld|
vals = Array(@metadata['recordInfoNote'].fetch(data_fld, []))
if admin_fields.include? model_fld
admin_attrs[model_fld] = vals[0] if vals.any?
if model_fld == 'ora_collection'
# ora_collection is mutlivalued
admin_attrs[model_fld] = vals if vals.any?
else
admin_attrs[model_fld] = vals[0] if vals.any?
end
elsif bib_fields.include? model_fld
bib_attrs[model_fld] = vals[0] if vals.any?
elsif license_fields.include? model_fld
Expand All @@ -877,7 +882,7 @@ def assign_record_info

# data responsbility was put in license and rights
vals = Array(@metadata.fetch('dataset_responsibility', []))
licence_attrs['data_responsibility'] = vals[0] if vals.any?
license_attrs['data_responsibility'] = vals[0] if vals.any?

assign_nested_hash('admin_information', admin_attrs) if admin_attrs.any?
assign_nested_hash('bibliographic_information', bib_attrs) if bib_attrs.any?
Expand Down

0 comments on commit 8d09c16

Please sign in to comment.