fix general retartedness on my side
This commit is contained in:
parent
bf9a845780
commit
4fad3416c0
2 changed files with 5 additions and 6 deletions
|
@ -31,10 +31,9 @@ class DataTable
|
|||
end
|
||||
|
||||
def query
|
||||
return @query if @query # Do not build query twice
|
||||
@query = @transactions.query
|
||||
@query.where(predicate) if predicate
|
||||
@query
|
||||
q = @transactions.query
|
||||
q.where(predicate) if predicate
|
||||
q
|
||||
end
|
||||
|
||||
def predicate
|
||||
|
|
|
@ -60,10 +60,10 @@ class TransactionsQuery
|
|||
def incoming
|
||||
@user.incoming_transactions.arel
|
||||
@transactions
|
||||
.where(@transactions[:debtor_id].eq(@user.id))
|
||||
.where(@transactions[:creditor_id].eq(@user.id))
|
||||
.project(
|
||||
@transactions[:amount],
|
||||
@transactions[:creditor_id].as('peer_id'),
|
||||
@transactions[:debtor_id].as('peer_id'),
|
||||
@transactions[:created_at].as('time'),
|
||||
@transactions[:issuer_id],
|
||||
@transactions[:issuer_type],
|
||||
|
|
Loading…
Reference in a new issue