From 810c5e32da4157813b905c2320ee4c25ebe1f848 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 16 Jun 2021 09:11:13 -0300 Subject: [PATCH] convertir valores en arrays por retrocompatibilidad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit esto permite indexar sitios antiguos y cargar artículos sin generar errores. --- app/models/metadata_array.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/metadata_array.rb b/app/models/metadata_array.rb index 9f5a84b6..96d3be3c 100644 --- a/app/models/metadata_array.rb +++ b/app/models/metadata_array.rb @@ -23,6 +23,14 @@ class MetadataArray < MetadataTemplate value.join(', ') end + # Obtiene el valor desde el documento, convirtiéndolo a Array si no lo + # era ya, por retrocompabilidad. + # + # @return [Array] + def document_value + [super].flatten(1) + end + alias indexable_values values private