mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Feat transactions search (#532)
* gem: Add ransack gem * feat: Implement transactions search
This commit is contained in:
parent
7f2633f9da
commit
cca779d3c4
9 changed files with 116 additions and 33 deletions
|
@ -13,6 +13,10 @@ class Account < ApplicationRecord
|
|||
|
||||
before_create :check_currency
|
||||
|
||||
def self.ransackable_attributes(auth_object = nil)
|
||||
%w[name]
|
||||
end
|
||||
|
||||
def trend(period = Period.all)
|
||||
first = balances.in_period(period).order(:date).first
|
||||
last = balances.in_period(period).order(date: :desc).first
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue