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
|
end
|
||||||
|
|
||||||
def query
|
def query
|
||||||
return @query if @query # Do not build query twice
|
q = @transactions.query
|
||||||
@query = @transactions.query
|
q.where(predicate) if predicate
|
||||||
@query.where(predicate) if predicate
|
q
|
||||||
@query
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def predicate
|
def predicate
|
||||||
|
|
|
@ -60,10 +60,10 @@ class TransactionsQuery
|
||||||
def incoming
|
def incoming
|
||||||
@user.incoming_transactions.arel
|
@user.incoming_transactions.arel
|
||||||
@transactions
|
@transactions
|
||||||
.where(@transactions[:debtor_id].eq(@user.id))
|
.where(@transactions[:creditor_id].eq(@user.id))
|
||||||
.project(
|
.project(
|
||||||
@transactions[:amount],
|
@transactions[:amount],
|
||||||
@transactions[:creditor_id].as('peer_id'),
|
@transactions[:debtor_id].as('peer_id'),
|
||||||
@transactions[:created_at].as('time'),
|
@transactions[:created_at].as('time'),
|
||||||
@transactions[:issuer_id],
|
@transactions[:issuer_id],
|
||||||
@transactions[:issuer_type],
|
@transactions[:issuer_type],
|
||||||
|
|
Loading…
Reference in a new issue