Files
adamantium/slices/main/repos/trip_repo.rb

21 lines
340 B
Ruby

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