mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02:00
* Add trends, time series, seed data * Remove test data * Replace old view values with helpers * Fix tooltip bugs in D3 chart * Fix tests * Fix smoke test * Add CRUD actions for valuations * Scaffold out inline editing with Turbo * Refactor series logic * Scaffold out basic sync process for accounts * Fix tests
9 lines
236 B
Ruby
9 lines
236 B
Ruby
class AccountBalance < ApplicationRecord
|
|
belongs_to :account
|
|
|
|
scope :in_period, ->(period) { period.date_range.nil? ? all : where(date: period.date_range) }
|
|
|
|
def trend(previous)
|
|
Trend.new(balance, previous&.balance)
|
|
end
|
|
end
|