Skip to content

Commit d8d1b74

Browse files
committed
Revert "sanitize for checks" - this is breaking hackatime!
This reverts commit b6c1a61.
1 parent b6c1a61 commit d8d1b74

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

app/models/concerns/heartbeatable.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,15 @@ def duration_seconds_boundary_aware(scope, start_time, end_time)
279279
capped_diffs = combined_scope
280280
.select("time, CASE
281281
WHEN LAG(time) OVER (ORDER BY time) IS NULL THEN 0
282-
ELSE LEAST(EXTRACT(EPOCH FROM (to_timestamp(time) - to_timestamp(LAG(time) OVER (ORDER BY time)))), ?)
283-
END as diff", heartbeat_timeout_duration.to_i)
282+
ELSE LEAST(EXTRACT(EPOCH FROM (to_timestamp(time) - to_timestamp(LAG(time) OVER (ORDER BY time)))), #{heartbeat_timeout_duration.to_i})
283+
END as diff")
284284
.where.not(time: nil)
285285
.order(time: :asc)
286286

287287
connection.select_value(
288-
connection.sanitize_sql_array([
289-
"SELECT COALESCE(SUM(diff), 0)::integer
290-
FROM (#{capped_diffs.to_sql}) AS diffs
291-
WHERE time >= ?",
292-
start_time
293-
])
288+
"SELECT COALESCE(SUM(diff), 0)::integer
289+
FROM (#{capped_diffs.to_sql}) AS diffs
290+
WHERE time >= #{start_time}"
294291
).to_i
295292
end
296293
end

0 commit comments

Comments
 (0)