Files
openfoodnetwork/app/models/custom_tab.rb
2024-06-20 11:56:09 +02:00

18 lines
347 B
Ruby

# frozen_string_literal: false
class CustomTab < ApplicationRecord
belongs_to :enterprise
validates :title, presence: true, length: { maximum: 20 }
# Remove any unsupported HTML.
def content
HtmlSanitizer.sanitize(super)
end
# Remove any unsupported HTML.
def content=(html)
super(HtmlSanitizer.sanitize(html))
end
end