mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
ActiveRecord::PreparedStatementInvalid in api/v1/stats # user_stats
This commit is contained in:
parent
515f51eab8
commit
f29e582dbf
1 changed files with 4 additions and 8 deletions
|
|
@ -284,14 +284,10 @@ module Heartbeatable
|
|||
.where.not(time: nil)
|
||||
.order(time: :asc)
|
||||
|
||||
connection.select_value(
|
||||
ActiveRecord::Base.sanitize_sql([
|
||||
"SELECT COALESCE(SUM(diff), 0)::integer
|
||||
FROM (#{capped_diffs.to_sql}) AS diffs
|
||||
WHERE time >= ?",
|
||||
start_time
|
||||
])
|
||||
).to_i
|
||||
sql = "SELECT COALESCE(SUM(diff), 0)::integer
|
||||
FROM (#{capped_diffs.to_sql}) AS diffs
|
||||
WHERE time >= #{connection.quote(start_time)}"
|
||||
connection.select_value(sql).to_i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue