5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 15:31:43 +00:00
panel/app/models/metadata_string.rb
2021-05-09 12:25:16 -03:00

24 lines
441 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
private
# No se permite HTML en las strings
def sanitize(string)
return '' if string.blank?
sanitizer.sanitize(string.strip,
tags: [],
attributes: []).strip.html_safe
end
end