Module: ActionMosaico::Attachments::TrixConversion

Extended by:
ActiveSupport::Concern
Included in:
ActionMosaico::Attachment
Defined in:
lib/action_mosaico/attachments/mosaico_conversion.rb

Instance Method Summary collapse

Instance Method Details

#to_mosaico_attachment(content = mosaico_attachment_content) ⇒ Object



22
23
24
25
26
# File 'lib/action_mosaico/attachments/mosaico_conversion.rb', line 22

def to_mosaico_attachment(content = mosaico_attachment_content)
  attributes = full_attributes.dup
  attributes['content'] = content if content
  TrixAttachment.from_attributes(attributes)
end