5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 14:06:21 +00:00

eliminar memoización en las búsquedas

This commit is contained in:
f 2021-05-13 19:47:00 -03:00
parent 38c5cdef81
commit bda56e3c10
2 changed files with 2 additions and 3 deletions

View file

@ -22,7 +22,7 @@ class MetadataRelatedPosts < MetadataArray
# Obtiene todos los posts y opcionalmente los filtra
def posts
@posts ||= site.posts(lang: lang).where(**filter)
site.posts(lang: lang).where(**filter)
end
def title(post)

View file

@ -93,8 +93,7 @@ class PostRelation < Array
def where(**args)
return self if args.empty?
@where ||= {}
@where[args.hash.to_s] ||= begin
begin
PostRelation.new(site: site, lang: lang).concat(select do |post|
result = args.map do |attr, value|
next unless post.attribute?(attr)