From 15fa653a6ddd4288283806738a5d706ee643bd14 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Oct 2023 10:15:13 -0300 Subject: [PATCH] feat: obtener el post indexado a partir del post --- app/models/post.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index fff9e17f..ab91bd43 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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