Skip to content

Commit 8cd82e3

Browse files
authored
Merge pull request #319 from MITLibraries/use-303-normalize-cdi-subjects
Parse CDI subjects to individual entries
2 parents 5f175d4 + 6b18d78 commit 8cd82e3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/models/normalize_primo_record.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ def location
311311
def subjects
312312
return [] unless @record['pnx']['display']['subject']
313313

314-
@record['pnx']['display']['subject']
314+
subs = @record['pnx']['display']['subject']
315+
subs.flat_map { |sub| sub.split(' ; ') }
315316
end
316317

317318
def availability

test/fixtures/primo/full_record.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
"A comprehensive study of testing methodologies"
2525
],
2626
"subject": [
27-
"Computer Science",
28-
"Software Testing"
27+
"Computer Science ; Software Testing"
2928
]
3029
},
3130
"addata": {

0 commit comments

Comments
 (0)