5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2025-03-14 17:38:18 +00:00

Merge branch 'issue-15068' into production.panel.sutty.nl

This commit is contained in:
f 2024-05-24 13:44:33 -03:00
commit 1e855242c5
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View file

@ -14,7 +14,7 @@ class MetadataGeo < MetadataTemplate
return true unless changed?
return true if empty?
self[:value] = value.transform_values(&:to_f)
self[:value] = value.transform_values(&:to_f).to_h
self[:value] = encrypt(value) if private?
true

View file

@ -3,16 +3,19 @@
# El título es obligatorio para todos los Post, si el esquema no lo
# incluye, tenemos que poder generar un valor legible por humanes.
class MetadataTitle < MetadataString
def titleize?
false
end
# Obtener todos los valores de texto del artículo y generar un título
# en base a eso.
#
# @return [String]
def default_value
@default_value ||=
post.attributes.select do |attr|
post[attr].titleize?
end.map do |attr|
post[attr].to_s
end.compact.join(' ').strip.squeeze(' ')
post.attributes.select do |attr|
post[attr].titleize?
end.map do |attr|
post[attr].to_s
end.compact.join(' ').strip.squeeze(' ')
end
end