From 46494bc07fcb22fa8f6800a7450118fd68053bea Mon Sep 17 00:00:00 2001 From: Dream <42954461+eureka928@users.noreply.github.com> Date: Sat, 21 Mar 2026 05:48:11 -0400 Subject: [PATCH] Fix rule condition merchant dropdown to show all merchants (#1240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- app/models/rule/condition_filter/transaction_merchant.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/rule/condition_filter/transaction_merchant.rb b/app/models/rule/condition_filter/transaction_merchant.rb index 581db1cdf..cc6f07644 100644 --- a/app/models/rule/condition_filter/transaction_merchant.rb +++ b/app/models/rule/condition_filter/transaction_merchant.rb @@ -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)