mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 22:59:39 +02:00
14 lines
282 B
Ruby
14 lines
282 B
Ruby
|
module Account::Entryable
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
TYPES = %w[ Account::Valuation Account::Transaction ]
|
||
|
|
||
|
def self.from_type(entryable_type)
|
||
|
entryable_type.presence_in(TYPES).constantize
|
||
|
end
|
||
|
|
||
|
included do
|
||
|
has_one :entry, as: :entryable, touch: true
|
||
|
end
|
||
|
end
|