mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
utc vs non utc is a subtle issue, tests were failing for a few hours every day cause of this
This commit is contained in:
parent
86cf7b1524
commit
e61a28f3e1
2 changed files with 6 additions and 3 deletions
|
@ -75,8 +75,11 @@ class Report
|
|||
def self.report_flags(report)
|
||||
report.data = []
|
||||
(0..30).to_a.reverse.each do |i|
|
||||
if (count = PostAction.where('date(created_at) = ?', i.days.ago.to_date).where(post_action_type_id: PostActionType.flag_types.values).count) > 0
|
||||
report.data << {x: i.days.ago.to_date.to_s, y: count}
|
||||
count = PostAction.where('date(created_at) = ?', i.days.ago.utc.to_date)
|
||||
.where(post_action_type_id: PostActionType.flag_types.values)
|
||||
.count
|
||||
if count > 0
|
||||
report.data << {x: i.days.ago.utc.to_date.to_s, y: count}
|
||||
end
|
||||
end
|
||||
flagsQuery = PostAction.where(post_action_type_id: PostActionType.flag_types.values)
|
||||
|
|
|
@ -140,4 +140,4 @@ describe Report do
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue