summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-04-27 11:19:20 +0200
committerhukl <contact@smyck.org>2009-04-27 11:19:20 +0200
commit7563dd7ef8b9bc6ba61e90976c5b5a1714230fb2 (patch)
treee5f45fc03b59de44281a56c45f9b2b9b1557a518 /app/models
parent91b9dc911418b4601795b8952cc35c866f0da246 (diff)
named scopes for media types
Diffstat (limited to 'app/models')
-rw-r--r--app/models/asset.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/models/asset.rb b/app/models/asset.rb
index c9c6296..4a20d73 100644
--- a/app/models/asset.rb
+++ b/app/models/asset.rb
@@ -7,4 +7,29 @@ class Asset < ActiveRecord::Base
7 :thumb => "100x100", 7 :thumb => "100x100",
8 } 8 }
9 ) 9 )
10
11 named_scope :images, :conditions => {
12 :upload_content_type => [
13 "image/gif",
14 "image/jpeg",
15 "image/png"
16 ]
17 }
18
19 named_scope :documents, :conditions => {
20 :upload_content_type => [
21 "application/pdf",
22 "text/plain",
23 "text/rtf"
24 ]
25 }
26
27 named_scope :audio, :conditions => {
28 :upload_content_type => [
29 "audio/mpeg",
30 "audio/x-m4a",
31 "audio/wav",
32 "audio/x-wav"
33 ]
34 }
10end 35end