Sha256: c02e8c2eac6efb222fd9fbfd0c6a9aae535f8782ab2eb61644e631aae1360e19
Contents?: true
Size: 1.2 KB
Versions: 12
Compression:
Stored size: 1.2 KB
Contents
class Card class Content # content-related methods for cards module All def content structured_content || standard_content end # alias_method :raw_content, :content # DEPRECATED! def content= value self.db_content = standardize_content value end def content? content.present? end def standard_content db_content || (new_card? ? default_content : "") end def standardize_content value value.is_a?(Array) ? items_content(value) : value end def structured_content structure && default_content end def refresh_content self.content = Card.find(id)&.db_content end def save_content_draft _content clear_drafts end def clear_drafts drafts.created_by(Card::Auth.current_id).each(&:delete) end def last_draft_content drafts.last.card_changes.last.value end def blank_content? content.blank? || content.strip.blank? end def nests? content_object.has_chunk? Content::Chunk::Nest end def content_object Card::Content.new content, self end end end end
Version data entries
12 entries across 12 versions & 1 rubygems