From 55f5797a54a942543442e0dd9832fb65f0678cd7 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 26 Jun 2018 20:44:23 -0300 Subject: [PATCH] los valores de los sub atributos tambien son unicos #51 --- app/models/post/template_field.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/post/template_field.rb b/app/models/post/template_field.rb index 59f4800..59fabee 100644 --- a/app/models/post/template_field.rb +++ b/app/models/post/template_field.rb @@ -268,6 +268,7 @@ class Post post.site.everything_of(attr, lang: collection) .compact .map { |sv| sv[subattr] } + .flatten .uniq else post.site.everything_of(attr, lang: collection).compact @@ -290,8 +291,6 @@ class Post end end - binding.pry if _value.last.nil? - # Crea un array de arrays, Ăștil para los select # [ [ 1, a ], [ 2, b ] ] # aunque si no hay un : en el autocompletado, el array queda