mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 10:06:23 +00:00
780d26f79a
si no existe en el esquema, generar un título en base a sus valores
28 lines
491 B
Ruby
28 lines
491 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Un campo de texto
|
|
class MetadataString < MetadataTemplate
|
|
# Una string vacía
|
|
def default_value
|
|
super || ''
|
|
end
|
|
|
|
def indexable?
|
|
true && !private?
|
|
end
|
|
|
|
def titleize?
|
|
true
|
|
end
|
|
|
|
private
|
|
|
|
# No se permite HTML en las strings
|
|
def sanitize(string)
|
|
return '' if string.blank?
|
|
|
|
sanitizer.sanitize(string.strip.unicode_normalize,
|
|
tags: [],
|
|
attributes: []).strip.html_safe
|
|
end
|
|
end
|