8fbbf41e29
This is allowed for existing instances so we don't end up 76 offenses right away, but for new code one should _only_ use this if they _have_ to remove non database data. Even then it's usually better to do this in a service class as this gives you more control over how to remove the data (e.g. in bulk).
14 lines
513 B
Ruby
14 lines
513 B
Ruby
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 # rubocop:disable Cop/ActiveRecordDependent
|
|
end
|