From 3b656f190852c9649cffa7cf86a50dedb592b7a2 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 26 Oct 2023 18:10:58 -0300 Subject: [PATCH] fix: obtener el post indexado a partir del post --- app/models/post.rb | 5 ----- app/models/post/indexable.rb | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index 227ef744..a595b024 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -63,11 +63,6 @@ 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 diff --git a/app/models/post/indexable.rb b/app/models/post/indexable.rb index 3aa8ce59..40be9b1c 100644 --- a/app/models/post/indexable.rb +++ b/app/models/post/indexable.rb @@ -10,6 +10,11 @@ class Post after_save :index! after_destroy :remove_from_index! + # @return [IndexedPost,nil] + def indexed_post + site.indexed_posts.find_by_post_id(uuid.value) + end + # Devuelve una versiĆ³n indexable del Post # # @return [IndexedPost]