Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/datacite/lupo into schema…
Browse files Browse the repository at this point in the history
…-4.5-r3
  • Loading branch information
codycooperross committed Dec 11, 2023
2 parents 2741a34 + 3c886cb commit 5da319a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ def as_indexed_json(_options = {})
"provider_id" => provider_id,
"consortium_id" => consortium_id,
"resource_type_id" => resource_type_id,
"person_id" => person_id,
"client_id_and_name" => client_id_and_name,
"provider_id_and_name" => provider_id_and_name,
"resource_type_id_and_name" => resource_type_id_and_name,
Expand Down Expand Up @@ -668,6 +669,7 @@ def as_indexed_json(_options = {})
"version_ids" => version_ids,
"version_of_ids" => version_of_ids,
"primary_title" => Array.wrap(primary_title),
"related_doi" => related_dois,
"publisher_obj" => publisher,
}
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/doi/indexer/related_doi_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
module Doi::Indexer
class RelatedDoiIndexer
def initialize(related_identifiers)
@related_identifiers = related_identifiers
@related_identifiers = Array.wrap(related_identifiers)
@related_dois = nil
end

def related_dois
@related_dois ||= @related_identifiers.select { |r| r["relatedIdentifierType"] == "DOI" }
@related_dois ||= @related_identifiers.select { |r| r.fetch("relatedIdentifierType", nil) == "DOI" }
end

def related_grouped_by_id
Expand Down

0 comments on commit 5da319a

Please sign in to comment.