Add trips

This commit is contained in:
2023-05-09 21:51:44 +10:00
parent ebdf051b82
commit 7988ffc76d
37 changed files with 651 additions and 2 deletions

View File

@@ -207,7 +207,7 @@ module Adamantium
def fetch!(slug)
posts
.published
.combine(:tags)
.combine(:tags, :trips)
.where(slug: slug)
.one!
end

18
app/repos/trip_repo.rb Normal file
View File

@@ -0,0 +1,18 @@
module Adamantium
module Repos
class TripRepo < Adamantium::Repo[:trips]
def fetch!(id)
trips
.where(id: id)
.combine(posts: :tags)
.one!
end
def list
trips
.order(:start_date)
.to_a
end
end
end
end