tab/app/helpers/transactions_helper.rb

12 lines
383 B
Ruby
Raw Normal View History

2015-09-08 15:25:54 +02:00
module TransactionsHelper
2015-09-08 20:45:32 +02:00
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
2015-09-08 15:25:54 +02:00
end