mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 23:32:53 +00:00
Merge pull request #435 from ImShyMike/fix-missing-category
This commit is contained in:
commit
6fa5de67cd
3 changed files with 5 additions and 2 deletions
|
|
@ -108,7 +108,7 @@ GEM
|
|||
bindex (0.8.1)
|
||||
bootsnap (1.18.6)
|
||||
msgpack (~> 1.2)
|
||||
brakeman (7.0.2)
|
||||
brakeman (7.1.0)
|
||||
racc
|
||||
builder (3.3.0)
|
||||
bullet (8.0.8)
|
||||
|
|
|
|||
|
|
@ -236,6 +236,9 @@ class Api::Hackatime::V1::HackatimeController < ApplicationController
|
|||
|
||||
parsed_ua = WakatimeService.parse_user_agent(heartbeat[:user_agent])
|
||||
|
||||
# if category is not set, just default to coding
|
||||
heartbeat[:category] ||= "coding"
|
||||
|
||||
# special case: if the entity is "test.txt", this is a test heartbeat
|
||||
if heartbeat[:entity] == "test.txt"
|
||||
source_type = :test_entry
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ include ApplicationHelper
|
|||
class TestWakatimeService
|
||||
def initialize(user: nil, specific_filters: [], allow_cache: true, limit: 10, start_date: nil, end_date: nil, scope: nil, boundary_aware: false)
|
||||
@scope = scope || Heartbeat.all
|
||||
# trusting time from hackatime extensions.....
|
||||
# trusting time from hackatime extensions.....
|
||||
# @scope = @scope.coding_only
|
||||
@scope = @scope.with_valid_timestamps
|
||||
@user = user
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue