Adds Attachment#title.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10012 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-16 16:42:23 +00:00
parent 570e1b1d62
commit 5c2de4dfc9
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -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