FIX merchant regression (#659)

This commit is contained in:
soky srm
2026-01-15 13:14:10 +01:00
committed by GitHub
parent a5ec5d3a62
commit d1b8d585ce
2 changed files with 10 additions and 1 deletions

View File

@@ -51,7 +51,8 @@ class Family < ApplicationRecord
.where(family: self)
.recently_unlinked
.pluck(:merchant_id)
Merchant.where(id: (assigned_ids + recently_unlinked_ids).uniq)
family_merchant_ids = merchants.pluck(:id)
Merchant.where(id: (assigned_ids + recently_unlinked_ids + family_merchant_ids).uniq)
end
def auto_categorize_transactions_later(transactions, rule_run_id: nil)

View File

@@ -6,4 +6,12 @@ class FamilyTest < ActiveSupport::TestCase
def setup
@syncable = families(:dylan_family)
end
test "available_merchants includes family merchants without transactions" do
family = families(:dylan_family)
new_merchant = family.merchants.create!(name: "New Test Merchant")
assert_includes family.available_merchants, new_merchant
end
end