Skip to content

Commit d6e5b62

Browse files
committed
Fix query to remove between upperbound
1 parent fc723ad commit d6e5b62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/controllers/podcast_metrics_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def episode_sparkline
1414
@episode_trend = calculate_episode_trend(@episode, @prev_episode)
1515
@sparkline_downloads =
1616
Rollups::HourlyDownload
17-
.where(episode_id: @episode[:guid], hour: (@episode.first_rss_published_at..Date.utc_today))
17+
.where(episode_id: @episode[:guid], hour: (@episode.first_rss_published_at..))
1818
.final
1919
.select(:episode_id, "DATE_TRUNC('DAY', hour) AS hour", "SUM(count) AS count")
2020
.group(:episode_id, "DATE_TRUNC('DAY', hour) AS hour")
@@ -235,7 +235,7 @@ def episode_dropday_query(ep)
235235
upperbound = lowerbound + 24.hours
236236

237237
Rollups::HourlyDownload
238-
.where(episode_id: ep[:guid], hour: (lowerbound..upperbound))
238+
.where(episode_id: ep[:guid], hour: (lowerbound...upperbound))
239239
.final
240240
.load_async
241241
.sum(:count)

0 commit comments

Comments
 (0)