mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 23:25:00 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user