Fix rule condition merchant dropdown to show all merchants (#1240)

The "transaction merchant" condition filter used `family.assigned_merchants`
which only returned merchants already assigned to a transaction. This meant
newly created merchants wouldn't appear in the rule condition dropdown until
manually assigned to a transaction.

Changed to `family.available_merchants` which includes all family merchants
(even unassigned ones), provider merchants on transactions, and recently
unlinked merchants — consistent with the transaction form merchant selector.

Fixes #1197

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dream
2026-03-21 05:48:11 -04:00
committed by GitHub
parent 30ef253536
commit 46494bc07f

View File

@@ -4,7 +4,7 @@ class Rule::ConditionFilter::TransactionMerchant < Rule::ConditionFilter
end
def options
family.assigned_merchants.alphabetically.pluck(:name, :id)
family.available_merchants.alphabetically.pluck(:name, :id)
end
def prepare(scope)