2016-02-22 14:49:16 -05:00
|
|
|
class Appearance < ActiveRecord::Base
|
2016-10-06 17:17:11 -04:00
|
|
|
include CacheMarkdownField
|
|
|
|
|
|
|
|
cache_markdown_field :description
|
|
|
|
|
2016-02-22 14:49:16 -05:00
|
|
|
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
|
2017-06-08 11:16:27 -04:00
|
|
|
has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
|
2016-02-22 14:49:16 -05:00
|
|
|
end
|