mirror of
https://0xacab.org/sutty/sutty
synced 2025-03-14 21:08:18 +00:00
Merge branch 'issue-15068' into production.panel.sutty.nl
This commit is contained in:
commit
1e855242c5
2 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue