Sha256: d575dbcad39c68dcb6c35a30ff24cb8d00433fff3ea97cb0379e8cf959cedb38

Contents?: true

Size: 356 Bytes

Versions: 4

Compression:

Stored size: 356 Bytes

Contents

require 'attachable'

class Attachment
  include Mongoid::Document
  include Mongoid::Timestamps
  include Attachable

  field :title
  field :filename
  attaches :file

  validates_with SafeHtml

  def url
    file.file_url
  end

  # TODO: Move this to a domain object in specialist publisher
  def snippet
    "[InlineAttachment:#{filename}]"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
govuk_content_models-8.6.0 app/models/attachment.rb
govuk_content_models-8.5.0 app/models/attachment.rb
govuk_content_models-8.4.1 app/models/attachment.rb
govuk_content_models-8.4.0 app/models/attachment.rb