diff --git a/app/models/transaction.rb b/app/models/transaction.rb index 8525157a..f3e2269b 100644 --- a/app/models/transaction.rb +++ b/app/models/transaction.rb @@ -22,7 +22,11 @@ def time end def signed_amount(account) - sign = from_account == account ? '-' : '+' + sign = negative?(account) ? '-' : '+' "#{sign}#{amount}" end + + def negative?(account) + from_account == account + end end diff --git a/app/views/transactions_mailer/transaction_notification.html.erb b/app/views/transactions_mailer/transaction_notification.html.erb index e0b543d6..2f7dab4b 100644 --- a/app/views/transactions_mailer/transaction_notification.html.erb +++ b/app/views/transactions_mailer/transaction_notification.html.erb @@ -1,21 +1,108 @@ -
Amount: <%= @transaction.signed_amount(@account) %>
-Description: <%= @transaction.description %>
-Current balance: <%= @account.balance %>
-Date | -Amount | -Description | -
---|
<%= transaction.date %> | -<%= transaction.signed_amount(@account) %> | -<%= transaction.description %> | +Date | +Amount | +Description |
---|