Skip to content

Commit

Permalink
Merge pull request #448 from nla/fix/blac-715_extent-information
Browse files Browse the repository at this point in the history
fix: return nil extent information to avoid displaying an empty metadata field
  • Loading branch information
yetti authored Jun 12, 2024
2 parents 6dcb67b + 8abbbaf commit eac2593
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 eac2593

Please sign in to comment.