summaryrefslogtreecommitdiff
path: root/app/models/asset.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-24 04:13:16 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-24 04:13:16 +0200
commite0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch)
treed0cf745592a46aee4d4913911fd34c7c24515220 /app/models/asset.rb
parent6424e10be5a89f175a74c71c55660412a169b8b8 (diff)
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile) - Updated config structure (application.rb, boot.rb, environment.rb) - Converted routes to Rails 3 DSL - Converted named_scope to scope throughout models - Converted find(:all, :conditions) to where() chains - Fixed has_many :order to use ordering scope - Updated session store and secret token configuration - Fixed exception_notification middleware configuration - Patched Ruby 2.4 / Rails 3.2 incompatibilities: - Integer/Float duration arithmetic (ActiveSupport) - Arel visit_Integer for PostgreSQL adapter - create_database String/Integer coercion - ActionController consider_all_requests_local - Migrated taggings schema for acts-as-taggable-on - Replaced dynamic_form gem with custom form_error_messages helper - Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for) - Fixed admin layout yield - Updated test suite for Rails 3 APIs
Diffstat (limited to 'app/models/asset.rb')
-rw-r--r--app/models/asset.rb29
1 files changed, 4 insertions, 25 deletions
diff --git a/app/models/asset.rb b/app/models/asset.rb
index 5bfea76..d27c525 100644
--- a/app/models/asset.rb
+++ b/app/models/asset.rb
@@ -11,29 +11,8 @@ class Asset < ActiveRecord::Base
11 :headline => "460x250#" 11 :headline => "460x250#"
12 } 12 }
13 ) 13 )
14 14
15 named_scope :images, :conditions => { 15 scope :images, where(:upload_content_type => ["image/gif", "image/jpeg", "image/png"])
16 :upload_content_type => [ 16 scope :documents, where(:upload_content_type => ["application/pdf", "text/plain", "text/rtf"])
17 "image/gif", 17 scope :audio, where(:upload_content_type => ["audio/mpeg", "audio/x-m4a", "audio/wav", "audio/x-wav"])
18 "image/jpeg",
19 "image/png"
20 ]
21 }
22
23 named_scope :documents, :conditions => {
24 :upload_content_type => [
25 "application/pdf",
26 "text/plain",
27 "text/rtf"
28 ]
29 }
30
31 named_scope :audio, :conditions => {
32 :upload_content_type => [
33 "audio/mpeg",
34 "audio/x-m4a",
35 "audio/wav",
36 "audio/x-wav"
37 ]
38 }
39end 18end