Skip to content
Snippets Groups Projects
Commit 36a25275 authored by Anusha Ranganathan's avatar Anusha Ranganathan
Browse files

Fix for no method error. Check attributes exist

parent 9120e3d1
Branches
Tags
1 merge request!310Fix for no method error. Check attributes exist
......@@ -265,13 +265,27 @@ module S3FileHandleable
complex_people.each do |person|
full_name = []
full_name << person.last_name[0].strip
last_names << person.last_name[0].strip
full_name << person.first_name[0].strip
first_names << person.first_name[0].strip
names << full_name.join(', ')
if person.last_name.any? and person.last_name.first.present?
full_name << person.last_name[0].strip
last_names << person.last_name[0].strip
else
full_name << ""
last_names << ""
end
if person.first_name.any? and person.first_name.first.present?
full_name << person.first_name[0].strip
first_names << person.first_name[0].strip
else
first_names << ""
end
names << full_name.join(', ') if full_name.any?
name_types << "Personal"
affiliations << person.affiliation[0].strip
if person.affiliation.any? and person.affiliation.first.present?
affiliations << person.affiliation[0].strip
else
affiliations << ""
end
if person.orcid.any? and person.orcid.first.present?
name_identifiers << person.orcid[0].strip
......@@ -285,6 +299,8 @@ module S3FileHandleable
if person.role.any? and person.role.first.present?
roles << person.role[0].strip
else
roles << ""
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment