5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 08:56:21 +00:00

feat: obtener el post indexado a partir del post

This commit is contained in:
f 2023-10-06 10:15:13 -03:00
parent 1ad4eeccb4
commit 15fa653a6d
No known key found for this signature in database

View file

@ -54,6 +54,11 @@ class Post
end end
end end
# @return [IndexedPost,nil]
def indexed_post
site.indexed_posts.find_by(locale: lang.value, path: id)
end
# Redefinir el inicializador de OpenStruct # Redefinir el inicializador de OpenStruct
# #
# @param :site [Site] el sitio en Sutty # @param :site [Site] el sitio en Sutty
@ -307,8 +312,6 @@ class Post
def destroy def destroy
run_callbacks :destroy do run_callbacks :destroy do
FileUtils.rm_f path.absolute FileUtils.rm_f path.absolute
site.delete_post self
end end
end end
alias destroy! destroy alias destroy! destroy