5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 08:16:26 +00:00

fix: un filtro con parámetros vacíos no devuelve una asociación

en cambio where(nil) no produce ningún efecto
This commit is contained in:
f 2023-10-20 12:23:01 -03:00
parent 5eafbaa5e9
commit 747ce788a2
No known key found for this signature in database

View file

@ -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)