From 8350bfdfeb971987abbf0d611f391280841bbd3f Mon Sep 17 00:00:00 2001 From: f Date: Fri, 20 Oct 2023 12:23:57 -0300 Subject: [PATCH] fix: no leer los posts al obtener relaciones --- app/views/posts/attribute_ro/_related_posts.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/posts/attribute_ro/_related_posts.haml b/app/views/posts/attribute_ro/_related_posts.haml index 6014e160..aa4aff2e 100644 --- a/app/views/posts/attribute_ro/_related_posts.haml +++ b/app/views/posts/attribute_ro/_related_posts.haml @@ -2,10 +2,9 @@ %th= post_label_t(attribute, post: post) %td %ul{ dir: dir, lang: locale } - - metadata.value.each do |v| - - p = site.indexed_posts(locale: post.lang.value).find_by(post_id: v)&.post + - site.indexed_posts.where(locale: post.lang.value, post_id: metadata.value).find_each do |p| -# XXX: Ignorar todos los posts no encontrados (ej: fueron borrados o el uuid cambiĆ³) - next unless p - %li= link_to p.title.value, site_post_path(site, p.id) + %li= link_to p.title, site_post_path(site, p.path)