topics with no reply data were strings

This commit is contained in:
Neil Lalonde 2015-06-30 15:42:38 -04:00
parent 1e2e450772
commit 8e76e6e4b7
2 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ class Report
def self.report_topics_with_no_response(report)
report.data = []
Topic.with_no_response_per_day(report.start_date, report.end_date, report.category_id).each do |r|
report.data << { x: Date.parse(r["date"]), y: r["count"] }
report.data << { x: Date.parse(r["date"]), y: r["count"].to_i }
end
report.total = Topic.with_no_response_total(category_id: report.category_id)
report.prev30Days = Topic.with_no_response_total(start_date: report.start_date - 30.days, end_date: report.start_date, category_id: report.category_id)

View File

@ -939,7 +939,7 @@ class Topic < ActiveRecord::Base
builder.where("t.category_id = :category_id", category_id: opts[:category_id]) if opts[:category_id]
builder.where("t.archetype <> '#{Archetype.private_message}'")
builder.where("t.deleted_at IS NULL")
builder.exec.first["count"]
builder.exec.first["count"].to_i
end
private