Story#113066359 - do not load all data on sum

This commit is contained in:
Vladimir Krylov 2016-02-11 08:36:15 +02:00
parent bd4477f962
commit ca037092d3
2 changed files with 6 additions and 5 deletions

View file

@ -45,7 +45,7 @@
.col-md-3
.col-md-2
.col-md-4{class: 'text-right'}
= t(:starting_balance) + " #{@sum.to_a.map(&:sum).sum.to_f} EUR"
= t(:starting_balance) + " #{@sum.to_f} EUR"
%hr
@ -66,10 +66,10 @@
%th{class: 'col-xs-2'}
= sort_link(@q, 'sum')
%tbody
-total = @sum.to_a.map(&:sum).sum.to_f
-total = @sum.to_f
- @account_activities.each do |x|
%tr
%td= link_to(x.account.registrar.try(:code), admin_registrar_path(x.account.registrar))
%td= x.account.registrar && link_to(x.account.registrar.try(:code), admin_registrar_path(x.account.registrar))
%td= x.description.present? ? x.description : '-'
%td= x.activity_type ? t(x.activity_type) : ''
%td= l(x.created_at)