mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 07:09:39 +02:00
* Flatten Holding model * Flatten balance model * Entries domain renames * Fix valuations reference * Fix trades stream * Fix brakeman warnings * Fix tests * Replace existing entryable type references in DB
9 lines
287 B
Ruby
9 lines
287 B
Ruby
class Balance < ApplicationRecord
|
|
include Monetizable
|
|
|
|
belongs_to :account
|
|
validates :account, :date, :balance, presence: true
|
|
monetize :balance
|
|
scope :in_period, ->(period) { period.nil? ? all : where(date: period.date_range) }
|
|
scope :chronological, -> { order(:date) }
|
|
end
|