curationexperts / cypripedium

A Hyrax 3 application for the Federal Reserve Bank of Minneapolis
2 stars 3 forks source link

Fix issue number indexing bug #587

Closed mark-dce closed 8 months ago

mark-dce commented 8 months ago

BUG Items with issues numbers with leading zeroes are being indexed as octal numbers instead of decimal: e.g. "060" --> 48 (base 8, octal) indtead of "060" --> 60 (base 10)

DIAGNOSIS Rails interprets a leading 0 in numeric literals as an octal number. See: https://docs.ruby-lang.org/en/2.0.0/syntax/literals_rdoc.html#label-Numbers

FIX Add a test and refactor the code to ensure we cast issue and volume strings to base-10 decimal integers.

BEFORE (id, issue_number_ssi[string], issue_number_isi[numeric])

image

AFTER

image