mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Rubocop run
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user