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:
parent
38c5cdef81
commit
bda56e3c10
2 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue