mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
* Add investment portfolio models * Add portfolio to demo data * Setup initial tests * Rough sketch of sync logic * Clean up trade sync logic * Add trade validation * Integrate trades into sync process
13 lines
297 B
Ruby
13 lines
297 B
Ruby
module Account::Entryable
|
|
extend ActiveSupport::Concern
|
|
|
|
TYPES = %w[ Account::Valuation Account::Transaction Account::Trade ]
|
|
|
|
def self.from_type(entryable_type)
|
|
entryable_type.presence_in(TYPES).constantize
|
|
end
|
|
|
|
included do
|
|
has_one :entry, as: :entryable, touch: true
|
|
end
|
|
end
|