mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: make report data export more resilient to inconsistent date format
The DAU/MAU report export was failing because of date being a string and not a valid Date value
This commit is contained in:
parent
54a9073d94
commit
cafd1241b9
@ -183,11 +183,11 @@ module Jobs
|
|||||||
|
|
||||||
report_hash = {}
|
report_hash = {}
|
||||||
Report.find(@extra[:name], @extra).data.each do |row|
|
Report.find(@extra[:name], @extra).data.each do |row|
|
||||||
report_hash[row[:x].to_s(:db)] = row[:y].to_s(:db)
|
report_hash[row[:x].to_s] = row[:y].to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
(@extra[:start_date].to_date..@extra[:end_date].to_date).each do |date|
|
(@extra[:start_date].to_date..@extra[:end_date].to_date).each do |date|
|
||||||
yield [date.to_s(:db), report_hash.fetch(date.to_s(:db), 0)]
|
yield [date.to_s(:db), report_hash.fetch(date.to_s, 0)]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user