Save syndication sources to posts
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user