1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Fix income summary totals (#759)

This commit is contained in:
Zach Gollwitzer 2024-05-17 17:50:49 -04:00 committed by GitHub
parent 0d0f766ca1
commit ac46c0c5a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -9,8 +9,8 @@ class Transaction < ApplicationRecord
monetize :amount
scope :inflows, -> { where("amount > 0") }
scope :outflows, -> { where("amount < 0") }
scope :inflows, -> { where("amount <= 0") }
scope :outflows, -> { where("amount > 0") }
scope :active, -> { where(excluded: false) }
scope :with_converted_amount, ->(currency = Current.family.currency) {
# Join with exchange rates to convert the amount to the given currency