Skip to content

Commit

Permalink
fix: return nil extent information to avoid displaying an empty heading
Browse files Browse the repository at this point in the history
  • Loading branch information
yetti committed Jun 12, 2024
1 parent 6dcb67b commit 8abbbaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ def extents_information
physdesc_facet
].compact.join(", ")

if quantity_unittype.blank?
extent_info = if quantity_unittype.blank?
dimensions_facet
else
[quantity_unittype, dimensions_facet].compact.join(", ")
end

extent_info.presence
end

def extract_notes_by_header(header)
Expand Down
4 changes: 2 additions & 2 deletions spec/models/solr_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
document.extents_information
end

it "returns an empty string" do
expect(extents_information_value).to eq ""
it "returns nil" do
expect(extents_information_value).to be_nil
end
end
end
Expand Down

0 comments on commit 8abbbaf

Please sign in to comment.