Allow editing deleted posts
This commit is contained in:
@@ -9,7 +9,7 @@ module Adamantium
|
||||
def call(url:, properties:)
|
||||
slug = URI(url).path.split("/").last
|
||||
|
||||
post = post_repo.fetch!(slug)
|
||||
post = post_repo.fetch_unpublished!(slug)
|
||||
markdown_content = ReverseMarkdown.convert(post.content, unknown_tags: :pass_through, github_flavored: true).to_s
|
||||
|
||||
if properties.nil? || properties.empty?
|
||||
|
@@ -161,6 +161,13 @@ module Adamantium
|
||||
.one!
|
||||
end
|
||||
|
||||
def fetch_unpublished!(slug)
|
||||
posts
|
||||
.combine(:tags)
|
||||
.where(slug: slug)
|
||||
.one!
|
||||
end
|
||||
|
||||
def find!(id)
|
||||
posts
|
||||
.by_pk(id)
|
||||
|
Reference in New Issue
Block a user