diff options
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r-- | app/models/attachment.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 0dda33023..9aeee07d0 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -137,6 +137,14 @@ class Attachment < ActiveRecord::Base File.join(self.class.storage_path, disk_filename.to_s) end + def title + title = filename.to_s + if description.present? + title << " (#{description})" + end + title + end + def increment_download increment!(:downloads) end |