Rubocop run

This commit is contained in:
Max Wofford
2025-03-15 21:16:51 -04:00
parent 7a141fb94b
commit d7f8685470
3 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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