mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Add the ability to "rollup" values in a time series (#554)
* Clean up time series models * Add value group rollup class for summarizing hierarchical data * Integrate new classes * Update UI to use new patterns * Update D3 charts to expect new data format * Clean up account model * More cleanup * Money improvements * Use new money fields * Remove invalid fixture data to avoid orphaned accountables * Update time series to work better with collections * Fix tests and UI bugs
This commit is contained in:
parent
0a8518506c
commit
f904d9d062
34 changed files with 687 additions and 391 deletions
|
@ -42,6 +42,10 @@ class Money
|
|||
@currency.default_format.gsub("%n", formatted_amount).gsub("%u", @currency.symbol)
|
||||
end
|
||||
|
||||
def to_json(*_args)
|
||||
{ amount: @amount, currency: @currency.iso_code }.to_json
|
||||
end
|
||||
|
||||
def <=>(other)
|
||||
raise TypeError, "Money can only be compared with other Money objects except for 0" unless other.is_a?(Money) || other.eql?(0)
|
||||
return @amount <=> other if other.is_a?(Numeric)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue