mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 10:26:22 +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:
parent
5eafbaa5e9
commit
747ce788a2
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue