fix general retartedness on my side

This commit is contained in:
Ilion Beyst 2015-09-11 12:07:39 +02:00
parent bf9a845780
commit 4fad3416c0
2 changed files with 5 additions and 6 deletions

View file

@ -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

View file

@ -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],