Class: Attachment
- Inherits:
-
Object
- Object
- Attachment
- Includes:
- Mongoid::Document, Mongoid::Paperclip, Mongoid::Timestamps
- Defined in:
- app/models/attachment.rb
Overview
Attachment uses Paperclip to attach files to any model including ContentItem and embeds Attachments.
For example:
Model {Page} (page.rb)
embeds_many :attachments
validates_associated :attachments
accepts_nested_attributes_for :attachments, :allow_destroy => true
If the attachment’s mime-type is ‘image’, the image will be preprocessed by imagick to several formats (:popup, :preview, :medium, :thumb, and :icon)
The maximum file size accepted can be configured in `application.yml` with :max_size_of_attachments_in_mb = 10
Constant Summary
- ASSET_PATH =
Where to store the files
File::join(Rails.root,'system')