From c6d96f3df7de512128e1387ea3eba8ac45b4eb6a Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sun, 4 Jan 2026 12:43:59 +0100 Subject: [PATCH] Move methods to private --- app/models/users/digest.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/users/digest.rb b/app/models/users/digest.rb index ea2f3882..b4d94549 100644 --- a/app/models/users/digest.rb +++ b/app/models/users/digest.rb @@ -132,14 +132,6 @@ class Users::Digest < ApplicationRecord (all_time_stats['total_distance'] || 0).to_i end - def total_tracked_minutes - top_countries_by_time.sum { |country| country['minutes'].to_i } - end - - def total_tracked_days - (total_tracked_minutes / 1440.0).round(1) - end - def untracked_days days_in_year = Date.leap?(year) ? 366 : 365 [days_in_year - total_tracked_days, 0].max.round(1) @@ -164,4 +156,12 @@ class Users::Digest < ApplicationRecord def generate_sharing_uuid self.sharing_uuid ||= SecureRandom.uuid end + + def total_tracked_days + (total_tracked_minutes / 1440.0).round(1) + end + + def total_tracked_minutes + top_countries_by_time.sum { |country| country['minutes'].to_i } + end end