From 833022c9c4d901634f2a431627060ea1754ad6ea Mon Sep 17 00:00:00 2001 From: f Date: Fri, 6 Oct 2023 17:35:54 -0300 Subject: [PATCH] fix: MetadataTemplate#locale es una String --- app/models/metadata_template.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/metadata_template.rb b/app/models/metadata_template.rb index a56f0bad..6e13aecd 100644 --- a/app/models/metadata_template.rb +++ b/app/models/metadata_template.rb @@ -66,13 +66,16 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type, # @deprecated Empezar a usar locale # @return [String] def lang - @lang ||= post&.lang&.value || I18n.locale + @lang ||= post&.lang&.value || I18n.locale.to_s end alias_method :locale, :lang + # El valor por defecto desde el esquema de datos + # + # @return [any] def default_value - layout.metadata.dig(name, 'default', lang.to_s) + layout.metadata.dig(name, 'default', lang) end # Valores posibles, busca todos los valores actuales en otros