Save syndication sources to posts

This commit is contained in:
2023-01-29 16:54:34 +11:00
parent 37932ea4ad
commit 2d371812f5
17 changed files with 231 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
module Adamantium
module Repos
class PostRepo < Adamantium::Repo[:posts]
commands :update
commands update: :by_pk
def create(post_attrs)
posts.transaction do
@@ -64,6 +64,12 @@ module Adamantium
.one!
end
def find!(id)
posts
.by_pk(id)
.one!
end
def slug_exists?(slug)
!!posts
.where(slug: slug)