Custom types in Ruby models used to be "any" types, which allow null values. This change allows e.g. barcodes to be nulled out or reset. I discovered this deficiency in the models while rolling out cocina-models 0.87.0, and patched around it: https://github.com/sul-dlss/argo/blob/main/app/services/item_change_set_persister.rb#L134-L143. This cocina-models patch will allow the prior behavior of being able to reset these custom type values when the attribute is not required by adding logic around determining optionality.
Why was this change made? 🤔
Custom types in Ruby models used to be "any" types, which allow null values. This change allows e.g. barcodes to be nulled out or reset. I discovered this deficiency in the models while rolling out cocina-models 0.87.0, and patched around it: https://github.com/sul-dlss/argo/blob/main/app/services/item_change_set_persister.rb#L134-L143. This cocina-models patch will allow the prior behavior of being able to reset these custom type values when the attribute is not required by adding logic around determining optionality.
How was this change tested? 🤨
sdr-infra
, against full QA datasetsdr-infra
, against full stage datasetsdr-infra
, against 500K prod dataset