summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/generic_file.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/generic_file.rb b/app/models/generic_file.rb
index 04c06df..24680af 100644
--- a/app/models/generic_file.rb
+++ b/app/models/generic_file.rb
@@ -42,6 +42,13 @@ class GenericFile < ActiveRecord::Base
end
end
+ def file_extension
+ mime_type = Mime::LOOKUP[self.file_type]
+ if mime_type.class == Mime::Type
+ return mime_type.symbol
+ end
+ end
+
private
def determine_file_type
if self.file_changed?