Fix trips

This commit is contained in:
2023-05-09 22:12:26 +10:00
parent 0b427934fc
commit 76e9e06e86
4 changed files with 195 additions and 53 deletions

View File

@@ -1,3 +1,5 @@
require "time_math"
module Admin
module Repos
class PostRepo < Adamantium::Repo[:posts]
@@ -48,8 +50,11 @@ module Admin
end
def created_between(start_date, end_date)
end_date = TimeMath.month.advance(end_date, +2)
posts
.combine(:trips)
.where(post_type: %w[post check-in])
.published_between(start_date, end_date)
end
end