mirror of
https://0xacab.org/sutty/sutty
synced 2025-03-15 02:38:17 +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 unless changed?
|
||||||
return true if empty?
|
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?
|
self[:value] = encrypt(value) if private?
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
|
@ -3,12 +3,15 @@
|
||||||
# El título es obligatorio para todos los Post, si el esquema no lo
|
# El título es obligatorio para todos los Post, si el esquema no lo
|
||||||
# incluye, tenemos que poder generar un valor legible por humanes.
|
# incluye, tenemos que poder generar un valor legible por humanes.
|
||||||
class MetadataTitle < MetadataString
|
class MetadataTitle < MetadataString
|
||||||
|
def titleize?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
# Obtener todos los valores de texto del artículo y generar un título
|
# Obtener todos los valores de texto del artículo y generar un título
|
||||||
# en base a eso.
|
# en base a eso.
|
||||||
#
|
#
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def default_value
|
def default_value
|
||||||
@default_value ||=
|
|
||||||
post.attributes.select do |attr|
|
post.attributes.select do |attr|
|
||||||
post[attr].titleize?
|
post[attr].titleize?
|
||||||
end.map do |attr|
|
end.map do |attr|
|
||||||
|
|
Loading…
Reference in a new issue