Commit 17e97b0cf03a74f85b12bff83e571421005c75d5

Authored by AntonioTerceiro
1 parent 4ef89586

ActionItem24: validating as attachment



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1151 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 2 additions and 0 deletions   Show diff stats
app/models/uploaded_file.rb
... ... @@ -3,6 +3,8 @@ class UploadedFile < Article
3 3 # FIXME need to define min/max file size
4 4 has_attachment :thumbnails => { :icon => [24,24] }, :storage => :file_system
5 5  
  6 + validates_as_attachment
  7 +
6 8 def icon_name
7 9 self.image? ? public_filename(:icon) : self.content_type.gsub('/', '-')
8 10 end
... ...