mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:46:21 +00:00
feat: obtener el post indexado a partir del post
This commit is contained in:
parent
1ad4eeccb4
commit
15fa653a6d
1 changed files with 5 additions and 2 deletions
|
@ -54,6 +54,11 @@ class Post
|
|||
end
|
||||
end
|
||||
|
||||
# @return [IndexedPost,nil]
|
||||
def indexed_post
|
||||
site.indexed_posts.find_by(locale: lang.value, path: id)
|
||||
end
|
||||
|
||||
# Redefinir el inicializador de OpenStruct
|
||||
#
|
||||
# @param :site [Site] el sitio en Sutty
|
||||
|
@ -307,8 +312,6 @@ class Post
|
|||
def destroy
|
||||
run_callbacks :destroy do
|
||||
FileUtils.rm_f path.absolute
|
||||
|
||||
site.delete_post self
|
||||
end
|
||||
end
|
||||
alias destroy! destroy
|
||||
|
|
Loading…
Reference in a new issue