tab/app/helpers/transactions_helper.rb
2015-09-08 20:45:32 +02:00

11 lines
383 B
Ruby

module TransactionsHelper
def get_transaction_peer(transaction, user)
return transaction.creditor if user == transaction.debtor
return transaction.debtor if user == transaction.creditor
end
def amount_in_perspective(transaction, user)
return -transaction.amount if user == transaction.debtor
return transaction.amount if user == transaction.creditor
end
end