summaryrefslogtreecommitdiff
path: root/app/models/appearance.rb
blob: c79326e84275ae1c5bc325076ca7db2c5567dc97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Appearance < ActiveRecord::Base
  include CacheMarkdownField

  cache_markdown_field :description

  validates :title,       presence: true
  validates :description, presence: true
  validates :logo,        file_size: { maximum: 1.megabyte }
  validates :header_logo, file_size: { maximum: 1.megabyte }

  mount_uploader :logo,         AttachmentUploader
  mount_uploader :header_logo,  AttachmentUploader
  has_many :uploads, as: :model, dependent: :destroy
end