From ca461257d07f60503d0d73bcf2df45cb445cde8e Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 28 Dec 2018 15:11:37 +0100 Subject: [PATCH] fix aggregate provider and client counts. #166 --- app/models/client.rb | 2 +- app/models/provider.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/client.rb b/app/models/client.rb index f95284507..5f16f2118 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -240,7 +240,7 @@ def year # count years account has been active. Ignore if deleted the same year as created def cumulative_years if deleted_at && deleted_at.year > created_at.year - (created_at.year..deleted_at.year).to_a + (created_at.year...deleted_at.year).to_a elsif deleted_at [] else diff --git a/app/models/provider.rb b/app/models/provider.rb index 3995e3f9a..259c85606 100644 --- a/app/models/provider.rb +++ b/app/models/provider.rb @@ -163,7 +163,7 @@ def year # count years account has been active. Ignore if deleted the same year as created def cumulative_years if deleted_at && deleted_at.year > created_at.year - (created_at.year..deleted_at.year).to_a + (created_at.year...deleted_at.year).to_a elsif deleted_at [] else