mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-26 00:29:40 +02:00
19 lines
449 B
Ruby
19 lines
449 B
Ruby
|
module Account::Linkable
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
belongs_to :plaid_account, optional: true
|
||
|
end
|
||
|
|
||
|
# A "linked" account gets transaction and balance data from a third party like Plaid
|
||
|
def linked?
|
||
|
plaid_account_id.present?
|
||
|
end
|
||
|
|
||
|
# An "offline" or "unlinked" account is one where the user tracks values and
|
||
|
# adds transactions manually, without the help of a data provider
|
||
|
def unlinked?
|
||
|
!linked?
|
||
|
end
|
||
|
end
|