From da8db07e941fdaeedaec0139e2282e98dc158e0c Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 25 Oct 2014 18:02:32 +0200 Subject: [PATCH] Make key of customer/invoice mapping a customer The key was the customer name before, but then it's not possible to use any other information of the customer model anymore. --- stoptime.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/stoptime.rb b/stoptime.rb index bec0e20..687173c 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -1377,7 +1377,7 @@ module StopTime::Controllers Customer.all.each do |customer| invoices = customer.invoices next if invoices.empty? - @invoices[customer.name] = invoices + @invoices[customer] = invoices invoices.each do |i| @input["paid_#{i.number}"] = true if i.paid? end @@ -2020,10 +2020,10 @@ module StopTime::Views else div.row do div.span7 do - @invoices.keys.sort.each do |key| - next if @invoices[key].empty? - h3 { key } - _invoice_list(@invoices[key]) + @invoices.keys.sort.each do |customer| + next if @invoices[customer].empty? + h3 { customer.name } + _invoice_list(@invoices[customer]) end end end