2024-02-02 09:05:04 -06:00
|
|
|
class Account < ApplicationRecord
|
2024-02-02 11:10:14 -06:00
|
|
|
VALID_ACCOUNT_TYPES = %w[Investment Depository Credit Loan Property Vehicle OtherAsset OtherLiability].freeze
|
2024-02-02 17:15:12 +00:00
|
|
|
|
2024-02-02 09:05:04 -06:00
|
|
|
belongs_to :family
|
2024-02-02 11:09:31 -06:00
|
|
|
|
2024-02-02 21:25:53 +00:00
|
|
|
delegated_type :accountable, types: %w[ Credit Depository Investment Loan OtherAsset OtherLiability Property Vehicle], dependant: :destroy
|
2024-02-02 23:09:35 +00:00
|
|
|
|
2024-02-02 17:15:12 +00:00
|
|
|
scope :depository, -> { where(type: "Depository") }
|
2024-02-02 09:05:04 -06:00
|
|
|
end
|