Skip to content

Commit 13d880e

Browse files
committed
TIMDEX content_type to sym
1 parent f517f5f commit 13d880e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/models/normalize_timdex_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def normalize
2121
location:,
2222
subjects:,
2323
# TIMDEX-specific fields
24-
'content_type' => content_type,
24+
content_type:,
2525
'dates' => dates,
2626
contributors:,
2727
'highlight' => highlight,

app/views/search/_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</h3>
77

88
<p class="pub-info">
9-
<span><%= result['content_type']&.each { |type| type['value'] }&.join(' ; ') %></span>
9+
<span><%= result[:content_type]&.each { |type| type['value'] }&.join(' ; ') %></span>
1010
<span>
1111
<% result['dates']&.each do |date| %>
1212
<%= date['value'] if date['kind'] == 'Publication date' %>

test/models/normalize_timdex_record_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def minimal_record
171171
{ 'value' => 'Dataset' },
172172
{ 'value' => 'Geospatial data' }
173173
]
174-
assert_equal expected_content_type, normalized['content_type']
174+
assert_equal expected_content_type, normalized[:content_type]
175175
end
176176

177177
test 'includes TIMDEX-specific dates field' do

test/models/normalize_timdex_results_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def empty_timdex_response
2727
assert_equal '2023', first_result[:year]
2828

2929
# Check TIMDEX-specific fields are preserved
30-
assert_includes first_result.keys, 'content_type'
30+
assert_includes first_result.keys, :content_type
3131
assert_includes first_result.keys, 'dates'
3232
assert_includes first_result.keys, :contributors
3333
assert_includes first_result.keys, 'highlight'

0 commit comments

Comments
 (0)