Skip to content

Commit 7bd2ba9

Browse files
authored
Merge pull request #1444 from PRX/fix/multiple_episodes_query
Fix multiple episode query
2 parents eeb4269 + 1a319da commit 7bd2ba9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/models/concerns/metrics_queries.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def alltime_downloads_query(model_id: metrics_default_id, column: metrics_defaul
1616
def daterange_downloads_query(model_id: metrics_default_id, column: metrics_default_column, date_start: metrics_default_date_start, date_end: nil, interval: "DAY")
1717
if model_id.is_a?(Array)
1818
Rollups::HourlyDownload
19+
.where(podcast_id: metrics_podcast_id)
1920
.where("#{column}": model_id, hour: (date_start..date_end))
2021
.group(column, "DATE_TRUNC('#{interval}', hour)")
2122
.order(Arel.sql("DATE_TRUNC('#{interval}', hour) ASC"))

0 commit comments

Comments
 (0)