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

24 lines
365 B
Ruby

module Admin
module Repos
class TripRepo < Adamantium::Repo[:trips]
commands :create
def list
trips
.order(:start_date)
.to_a
end
def fetch(id)
trips.where(id: id).one
end
def update(id, trip)
trips
.where(id: id)
.update(trip)
end
end
end
end