blob: aca0ee80618bca66cdaea79464e9ae7a5d1c6284 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
class Asset < ApplicationRecord
include FileAttachment
has_many :related_assets, :dependent => :destroy
has_many :pages, :through => :related_assets
scope :images, -> { where(:upload_content_type => ["image/gif", "image/jpeg", "image/png", "image/webp"]) }
scope :documents, -> { where(:upload_content_type => ["application/pdf", "text/plain", "text/rtf"]) }
scope :audio, -> { where(:upload_content_type => ["audio/mpeg", "audio/x-m4a", "audio/wav", "audio/x-wav"]) }
end
|