Filter out raw_data (#1099)

This commit is contained in:
Mahad Kalam 2026-03-22 18:33:01 +00:00 committed by GitHub
parent 95580df3ba
commit 245c458f41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,7 +273,9 @@ class Api::Hackatime::V1::HackatimeController < ApplicationController
editor: parsed_ua[:editor],
operating_system: parsed_ua[:os],
machine: request.headers["X-Machine-Name"]
})
}).slice(*Heartbeat.column_names.map(&:to_sym))
# ^^ They say safety laws are written in blood. Well, so is this line!
# Basically this filters out columns that aren't in our DB (the biggest one being raw_data)
new_heartbeat = Heartbeat.find_or_create_by(attrs)
queue_project_mapping(heartbeat[:project])