Add trips
This commit is contained in:
15
slices/admin/repos/trip_repo.rb
Normal file
15
slices/admin/repos/trip_repo.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user