summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/asset.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/asset.rb b/app/models/asset.rb
index 9feefa9..ba9c2f0 100644
--- a/app/models/asset.rb
+++ b/app/models/asset.rb
@@ -10,6 +10,8 @@ class Asset < ApplicationRecord
10 scope :images, -> { where(:upload_content_type => IMAGE_CONTENT_TYPES) } 10 scope :images, -> { where(:upload_content_type => IMAGE_CONTENT_TYPES) }
11 scope :documents, -> { where(:upload_content_type => ["application/pdf", "text/plain", "text/rtf"]) } 11 scope :documents, -> { where(:upload_content_type => ["application/pdf", "text/plain", "text/rtf"]) }
12 scope :audio, -> { where(:upload_content_type => ["audio/mpeg", "audio/x-m4a", "audio/wav", "audio/x-wav"]) } 12 scope :audio, -> { where(:upload_content_type => ["audio/mpeg", "audio/x-m4a", "audio/wav", "audio/x-wav"]) }
13 scope :pdfs, -> { where(:upload_content_type => PDF_CONTENT_TYPE) }
14
13 scope :headline_eligible, -> { where(:upload_content_type => IMAGE_CONTENT_TYPES + [PDF_CONTENT_TYPE]) } 15 scope :headline_eligible, -> { where(:upload_content_type => IMAGE_CONTENT_TYPES + [PDF_CONTENT_TYPE]) }
14 16
15 validates :license_key, inclusion: { in: -> { AssetLicense.keys } }, allow_blank: true 17 validates :license_key, inclusion: { in: -> { AssetLicense.keys } }, allow_blank: true