From 747ce788a25f3f3e48e83287aea6351515ebe3dd Mon Sep 17 00:00:00 2001 From: f Date: Fri, 20 Oct 2023 12:23:01 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20un=20filtro=20con=20par=C3=A1metros=20va?= =?UTF-8?q?c=C3=ADos=20no=20devuelve=20una=20asociaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit en cambio where(nil) no produce ningĂșn efecto --- app/models/metadata_related_posts.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/metadata_related_posts.rb b/app/models/metadata_related_posts.rb index 50b8660e..a9aaaa21 100644 --- a/app/models/metadata_related_posts.rb +++ b/app/models/metadata_related_posts.rb @@ -34,14 +34,14 @@ class MetadataRelatedPosts < MetadataArray # # @return [IndexedPost::ActiveRecord_AssociationRelation] def posts - site.indexed_posts.where(locale: locale).where.not(post_id: post.uuid.value).where(**filter) + site.indexed_posts.where(locale: locale).where.not(post_id: post.uuid.value).where(filter) end # Encuentra el filtro desde el esquema del atributo # - # @return [Hash] + # @return [Hash,nil] def filter - layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys || {} + layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys end def sanitize(uuid)