Skip to content

Commit

Permalink
add a comment about map
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Dec 4, 2019
1 parent a40f117 commit 96ba763
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/services/metadata_service.rb
Expand Up @@ -13,6 +13,8 @@ class << self
def resolvable(identifiers)
res_ids = identifiers.select { |identifier| can_resolve?(identifier) }
VALID_PREFIXES.map { |prefix| res_ids.find { |res_id| res_id.start_with?(prefix.to_s) } }.compact
# NOTE: the purpose of .map here is to ensure we return any resolvable identifiers in the the
# preferred order specificed above in KNOWN_PREFIXES, so that the .first is the preferred one
end

def fetch(identifier)
Expand Down

0 comments on commit 96ba763

Please sign in to comment.