mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
* Initial data objects * Remove trend calculator * Fill in balance reconciliation for entry group * Initial tooltip component * Balance trends in activity view * Lint fixes * trade partial alignment fix * Tweaks to balance calculation to acknowledge holdings value better * More lint fixes * Bump brakeman dep * Test fixes * Remove unused class
9 lines
302 B
Ruby
9 lines
302 B
Ruby
class Balance < ApplicationRecord
|
|
include Monetizable
|
|
|
|
belongs_to :account
|
|
validates :account, :date, :balance, presence: true
|
|
monetize :balance, :cash_balance
|
|
scope :in_period, ->(period) { period.nil? ? all : where(date: period.date_range) }
|
|
scope :chronological, -> { order(:date) }
|
|
end
|