Files
adamantium/app/repos/trip_repo.rb
2023-05-10 20:39:22 +10:00

20 lines
329 B
Ruby

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