First pass at webmentions
This commit is contained in:
@@ -11,6 +11,8 @@ module Adamantium
|
||||
|
||||
has_many :post_trips
|
||||
has_many :trips, through: :post_trips
|
||||
|
||||
has_many :webmentions
|
||||
end
|
||||
end
|
||||
|
||||
|
21
lib/adamantium/persistence/relations/webmentions.rb
Normal file
21
lib/adamantium/persistence/relations/webmentions.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Adamantium
|
||||
module Persistence
|
||||
module Relations
|
||||
class Webmentions < ROM::Relation[:sql]
|
||||
schema :webmentions, infer: true do
|
||||
associations do
|
||||
belongs_to :post
|
||||
end
|
||||
end
|
||||
|
||||
auto_struct(true)
|
||||
|
||||
def published
|
||||
where(self[:published_at] <= Time.now)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user