Add trips
This commit is contained in:
@@ -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
18
app/repos/trip_repo.rb
Normal 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
|
Reference in New Issue
Block a user