diff --git a/app/models/concerns/heartbeatable.rb b/app/models/concerns/heartbeatable.rb index b00c85d..e6fae4f 100644 --- a/app/models/concerns/heartbeatable.rb +++ b/app/models/concerns/heartbeatable.rb @@ -4,7 +4,7 @@ module Heartbeatable included do # Filter heartbeats to only include those with category equal to "coding" scope :coding_only, -> { where(category: "coding") } - + # This is to prevent PG timestamp overflow errors if someones gives us a # heartbeat with a time that is enormously far in the future. scope :with_valid_timestamps, -> { where("time >= 0 AND time <= ?", 253402300799) } @@ -59,7 +59,7 @@ module Heartbeatable def duration_seconds(scope = all) scope = scope.coding_only.with_valid_timestamps - + if scope.group_values.any? group_column = scope.group_values.first diff --git a/app/models/user.rb b/app/models/user.rb index 772df63..cd0fbbd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -187,7 +187,7 @@ class User < ApplicationRecord email = email_addresses&.first&.email return "error displaying name" unless email.present? - email.split('@')&.first + " (email sign-up)" + email.split("@")&.first + " (email sign-up)" end def project_names diff --git a/db/migrate/20250315214819_add_index_category_time_heartbeats.rb b/db/migrate/20250315214819_add_index_category_time_heartbeats.rb index d66027c..a9c421b 100644 --- a/db/migrate/20250315214819_add_index_category_time_heartbeats.rb +++ b/db/migrate/20250315214819_add_index_category_time_heartbeats.rb @@ -1,5 +1,5 @@ class AddIndexCategoryTimeHeartbeats < ActiveRecord::Migration[8.0] def change - add_index :heartbeats, [:category, :time], name: 'index_heartbeats_on_category_and_time' + add_index :heartbeats, [ :category, :time ], name: 'index_heartbeats_on_category_and_time' end end