feat: scope Mercury account uniqueness to mercury_item (#1032)

* feat: scope Mercury account uniqueness to mercury_item

* feat: extend to all other providers

* fix: add uniqueness test

* fix: lint

* fix: test

* fix: coderabbit comment

* fix: coderabbit comment

* fix: coderabbit comment

* fix: update

* fix: lint

* fix: update

* fix: update
This commit is contained in:
Clayton
2026-03-19 09:17:55 -05:00
committed by GitHub
parent b68c767b34
commit 1191d9f7d8
17 changed files with 461 additions and 117 deletions

View File

@@ -15,6 +15,7 @@ class MercuryAccount < ApplicationRecord
has_one :linked_account, through: :account_provider, source: :account
validates :name, :currency, presence: true
validates :account_id, uniqueness: { scope: :mercury_item_id }
# Helper to get account using account_providers system
def current_account