mirror of
https://github.com/we-promise/sure.git
synced 2026-05-31 16:29:03 +00:00
* fix(merchants): preserve manual merchant edits across provider sync Fixes #1977. Merging merchants, converting a synced (provider) merchant to a family merchant, and unlinking a merchant all reassign transactions.merchant_id via update_all without flagging the entries as user_modified. The next provider sync sees the entries as unmodified and reverts the change. Add Entry.mark_user_modified_for_transactions! and call it (before the merchant_id update, so the scope still matches) in Merchant::Merger#merge!, ProviderMerchant#convert_to_family_merchant_for, and #unlink_from_family. The sync skip-guard already honours user_modified, so flagged entries are left untouched on subsequent syncs. * fix(merchants): pass transaction relation to bulk user_modified helper Addresses PR #1981 review (CodeRabbit): mark_user_modified_for_transactions! now accepts an ActiveRecord::Relation and selects ids via subquery, so large merges/unlinks don't materialize ids or hit SQL parameter limits. Array of ids still supported. Callers pass the scope relation directly.