Bring app in line with Hanami 2.1.0 base
This commit is contained in:
20
app/relations/trips.rb
Normal file
20
app/relations/trips.rb
Normal 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
|
Reference in New Issue
Block a user