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