Bring app in line with Hanami 2.1.0 base

This commit is contained in:
2023-11-18 08:49:08 +11:00
parent e1a230bdba
commit 484259fab1
24 changed files with 232 additions and 220 deletions

20
app/relations/trips.rb Normal file
View File

@@ -0,0 +1,20 @@
# frozen_string_literal: true
module Adamantium
module Relations
class Trips < ROM::Relation[:sql]
schema :trips, infer: true do
associations do
has_many :post_trips
has_many :posts, through: :post_trips
end
end
auto_struct(true)
def published
where(self[:start_date] <= Time.now)
end
end
end
end