From 553115fd50ef3c35d961fa98abfd593386da5c94 Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 28 Jan 2013 11:07:14 +0100 Subject: fax document count fixed --- app/views/fax_accounts/_index_core.html.haml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/fax_accounts/_index_core.html.haml b/app/views/fax_accounts/_index_core.html.haml index f86a4ac..d694f8f 100644 --- a/app/views/fax_accounts/_index_core.html.haml +++ b/app/views/fax_accounts/_index_core.html.haml @@ -28,9 +28,11 @@ %br = truncate(fax_account.station_id, :length => 20) %td - = link_to fax_account.fax_documents.inbound.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{fax_account.fax_documents.inbound.first.try(:id)}") + - inbound_documents = fax_account.fax_documents.where(:inbound => true) + - outbound_documents = fax_account.fax_documents.where(:inbound => [false, nil]) + = link_to inbound_documents.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{inbound_documents.first.try(:id)}") = '/' - = link_to fax_account.fax_documents.outbound.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{fax_account.fax_documents.outbound.first.try(:id)}") + = link_to outbound_documents.count, fax_account_fax_documents_path(fax_account, :anchor => "fax_document_#{outbound_documents.first.try(:id)}") - if fax_account.fax_documents.any? %br %small -- cgit v1.2.3