Files
fizzy/app/models
Peter Baker e0d66b2fd0 Fix ambiguous column in SQLite FTS multi-term search (#2688)
* Fix multi-term SQLite FTS5 search causing a 500 error

When filtering cards by more than one term, `matching` was called
once per term via an association join. Rails did not deduplicate
association joins, resulting in two JOINs to `search_records_fts`
in a single query. SQLite FTS5 then raised "ambiguous column name"
when evaluating the MATCH condition.

Fix by using a string join instead, which Rails deduplicates so
only one JOIN to `search_records_fts` is generated regardless of
how many terms are searched.

Fixes: https://github.com/basecamp/fizzy/discussions/2354

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: verify multi-term search requires ALL terms to match

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Mike Dalessio <mike@37signals.com>
2026-03-18 11:38:06 -04:00
..
2026-02-17 13:57:24 +01:00
2025-12-11 10:25:34 +01:00
2026-03-18 11:51:10 +01:00
2026-03-18 11:51:10 +01:00
2025-12-09 20:24:09 -05:00
2026-03-11 13:36:09 +01:00
2026-02-02 12:36:48 +01:00
2025-12-16 16:44:20 +01:00
2026-02-02 13:38:34 +01:00
2025-11-14 11:44:04 +01:00
2026-02-02 13:38:34 +01:00
2026-03-18 11:51:10 +01:00
2025-07-21 20:11:03 -05:00
2025-11-17 09:11:36 -05:00
2025-11-17 09:12:40 -05:00
2026-01-15 23:22:21 -05:00