Skip to content

Commit

Permalink
Ensures containers display only changes case of first character.
Browse files Browse the repository at this point in the history
  • Loading branch information
randalldfloyd committed Dec 6, 2023
1 parent 965a77f commit f005ae8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/models/concerns/arclight/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ def digital_objects
end

def containers
# NOTE: that .titlecase strips punctuation, like hyphens, we want to keep
fetch('containers_ssim', []).map(&:capitalize)
# NOTE: Keep uppercase characters if present, but upcase the first if not already
containers_field = fetch('containers_ssim', []).reject(&:empty?)
return [] if containers_field.blank?

containers_field.map do |container|
container.dup.sub!(/\A./, &:upcase)
end
end

# @return [Array<String>] with embedded highlights using <em>...</em>
Expand Down

0 comments on commit f005ae8

Please sign in to comment.