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