From 17e97b0cf03a74f85b12bff83e571421005c75d5 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 28 Dec 2007 18:06:06 +0000 Subject: [PATCH] ActionItem24: validating as attachment --- app/models/uploaded_file.rb | 2 ++ 1 file changed, 2 insertions(+), 0 deletions(-) diff --git a/app/models/uploaded_file.rb b/app/models/uploaded_file.rb index 469537f..430ba51 100644 --- a/app/models/uploaded_file.rb +++ b/app/models/uploaded_file.rb @@ -3,6 +3,8 @@ class UploadedFile < Article # FIXME need to define min/max file size has_attachment :thumbnails => { :icon => [24,24] }, :storage => :file_system + validates_as_attachment + def icon_name self.image? ? public_filename(:icon) : self.content_type.gsub('/', '-') end -- libgit2 0.21.2