mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 13:52:50 +08:00
don't fail this query cause avg_time is 0
This commit is contained in:
parent
e77c396a19
commit
7681ba0c32
|
@ -298,6 +298,7 @@ class Topic < ActiveRecord::Base
|
||||||
FROM (SELECT topic_id,
|
FROM (SELECT topic_id,
|
||||||
round(exp(avg(ln(avg_time)))) AS gmean
|
round(exp(avg(ln(avg_time)))) AS gmean
|
||||||
FROM posts
|
FROM posts
|
||||||
|
WHERE avg_time > 0 AND avg_time IS NOT NULL
|
||||||
GROUP BY topic_id) AS x
|
GROUP BY topic_id) AS x
|
||||||
WHERE x.topic_id = topics.id")
|
WHERE x.topic_id = topics.id")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user