From cb82904c306f59a586b475c2198445cb8ce3d1b7 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 22 Jan 2026 21:20:53 -0600 Subject: [PATCH] models: Prepend empty item to Alma Item Set lists Since we have two dropdowns with the same name, their values will both be sent on requests. The sandbox dropdown is last, so its value will take precedence over the production list. By having an empty item as the first item, the value will be blank and the selected item in the production list will be used. Closes: AP-560 --- app/models/alma/item_set.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/alma/item_set.rb b/app/models/alma/item_set.rb index 2fd20098..32dd9d2b 100644 --- a/app/models/alma/item_set.rb +++ b/app/models/alma/item_set.rb @@ -66,9 +66,11 @@ def prepend_note_to_set(env, id, note, num, email) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength def fetch_item_sets(source) + # Start with empty entry, so the dropdowns start with no selected set. + sets = [['', '']] + # We can only fetch 100 item sets at a time so we # have to loop through the API to get all of them - sets = [] offset = 0 loop do