Skip to content

Convert no-holds items to 1-day holds#2159

Open
phinze wants to merge 1 commit intomainfrom
convert-no-holds-to-one-day-holds
Open

Convert no-holds items to 1-day holds#2159
phinze wants to merge 1 commit intomainfrom
convert-no-holds-to-one-day-holds

Conversation

@phinze
Copy link
Copy Markdown
Contributor

@phinze phinze commented Apr 24, 2026

What it does

Runs a data migration that flips the 57 active holds_enabled=false items to holds_enabled=true, hold_duration=1, turning the old "no holds" set into one-day-hold items. Also adds a before_save on Item that nulls hold_duration whenever holds_enabled gets unchecked, so the two fields can't drift apart.

Why it is important

When one-day holds went out in #2118, Tessa flagged that items which used to be no-holds were showing up as regular 7-day holds. Digging through the audit trail, the actual story was that staff had been flipping the checkbox back on manually over the past few months, sometimes without setting the new hold duration dropdown. The original intent was always for one-day holds to replace no-holds for high-demand seasonal items (power washers, carpet cleaners, weed whackers, reel mowers), so rather than ask staff to re-touch 57 items by hand, we do it here.

The holds_enabled=false state still works the way it always has, in case we want to bring it back — it's just no longer the default path for short-hold items.

Closes #2157

UI Change Screenshot

No UI changes.

Implementation notes

The migration uses update! with an audit_comment rather than update_all, so each converted item gets a readable entry in its audit history ("Converted from no-holds to 1-day hold (issue #2157)"). At 57 rows the perf cost of iterating is a rounding error.

There are also 13 stragglers — items that staff previously flipped from no-holds back to enabled without setting a duration, so they currently act as 7-day holds. A couple are clearly intentional (named "Metal wheelbarrow - 7 day hold") and a few are ambiguous. I'll post the list on #2157 once this lands so Tessa can triage.

After one-day holds shipped in #2118, Tessa noticed that items which
used to be no-holds were now letting members place regular 7-day
holds. The real story was that staff had been flipping holds_enabled
back on by hand and sometimes forgetting to set the new hold duration
dropdown, and the original plan was for one-day holds to replace
no-holds for high-demand seasonal items anyway.

Migrates active holds_enabled=false items to holds_enabled=true with
hold_duration=1, leaving retired items alone. Adds a before_save
callback that nulls hold_duration whenever holds get disabled, so the
two fields can't drift apart (a handful of items had already ended up
in that inconsistent state).

Closes #2157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Honor holds_enabled in one-day holds flow and convert no-holds items to 1-day holds

2 participants