Sha256: 2484f397a8546b8d78ff93cf94da05b1bc1f08c635499d44aaec1b354a379c88
Contents?: true
Size: 1003 Bytes
Versions: 5
Compression:
Stored size: 1003 Bytes
Contents
::Card.error_codes[:conflict] = [:conflict, 409] def content db_content || (new_card? && template.db_content) end def content= value self.db_content = value end def raw_content structure ? template.db_content : content end format do def chunk_list # override to customize by set :default end end def label name end def creator Card[creator_id] end def updater Card[updater_id] end def clean_html? true end def history? false 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 event :save_draft, before: :store, on: :update, when: proc { Env.params['draft'] == 'true' } do save_content_draft content abort :success end event :set_default_content, on: :create, before: :approve do if !db_content_changed? && template && template.db_content.present? self.db_content = template.db_content end end
Version data entries
5 entries across 5 versions & 1 rubygems