From bd3df6c1863fcec19c98e79070360e7bd49588bc Mon Sep 17 00:00:00 2001 From: f Date: Tue, 2 Jul 2024 13:01:13 -0300 Subject: [PATCH] fix: new_predefined_array con valores legibles por humanes --- app/models/metadata_predefined_array.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models/metadata_predefined_array.rb b/app/models/metadata_predefined_array.rb index b8e5050e..566a491b 100644 --- a/app/models/metadata_predefined_array.rb +++ b/app/models/metadata_predefined_array.rb @@ -7,4 +7,13 @@ class MetadataPredefinedArray < MetadataArray [v[I18n.locale.to_s], k] end&.to_h end + + # Devolver los valores legibles por humanes + # + # @todo Debería devolver los valores en el idioma del post, no de le + # usuarie + # @return [String] + def to_s + values.invert.select { |x, k| value.include?(x) }.values.join(', ') + end end