mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-29 22:56:21 +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]
|
# @return [IndexedPost::ActiveRecord_AssociationRelation]
|
||||||
def posts
|
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
|
end
|
||||||
|
|
||||||
# Encuentra el filtro desde el esquema del atributo
|
# Encuentra el filtro desde el esquema del atributo
|
||||||
#
|
#
|
||||||
# @return [Hash]
|
# @return [Hash,nil]
|
||||||
def filter
|
def filter
|
||||||
layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys || {}
|
layout.metadata.dig(name, 'filter')&.to_h&.symbolize_keys
|
||||||
end
|
end
|
||||||
|
|
||||||
def sanitize(uuid)
|
def sanitize(uuid)
|
||||||
|
|
Loading…
Reference in a new issue