Sha256: 4f5de2110133daff54d5aa94e4cc27d9c908f0c9eceef6fd5fafc2d28713f437
Contents?: true
Size: 552 Bytes
Versions: 14
Compression:
Stored size: 552 Bytes
Contents
# frozen_string_literal: true module Katalyst module Content class Content < Item has_rich_text :content validates :content, presence: true default_scope { with_rich_text_content } def initialize_copy(source) super self.content = source.content&.body if source.content.is_a?(ActionText::RichText) end def self.permitted_params super + %i[content] end def to_plain_text [super, content.to_plain_text].compact.join("\n") if visible? end end end end
Version data entries
14 entries across 14 versions & 1 rubygems