summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-28 11:20:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-28 11:20:13 +0000
commite4a9ce6db0a22179b6ba6541b1d2dc63786dee67 (patch)
tree06afaa1a98298d44e06994becdccdc63e99f6fb9 /app/models/attachment.rb
parent584fbc8f8b52ceed79836d8b2f877d34dcc1e638 (diff)
downloadredmine-e4a9ce6db0a22179b6ba6541b1d2dc63786dee67.tar.gz
redmine-e4a9ce6db0a22179b6ba6541b1d2dc63786dee67.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9564 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r--app/models/attachment.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index c641f3006..5af82a2e3 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -44,7 +44,7 @@ class Attachment < ActiveRecord::Base
"LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
cattr_accessor :storage_path
- @@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{Rails.root}/files"
+ @@storage_path = Redmine::Configuration['attachments_storage_path'] || File.join(Rails.root, "files")
before_save :files_to_final_location
after_destroy :delete_from_disk
@@ -125,7 +125,7 @@ class Attachment < ActiveRecord::Base
# Returns file's location on disk
def diskfile
- "#{@@storage_path}/#{self.disk_filename}"
+ File.join(self.class.storage_path, disk_filename.to_s)
end
def increment_download