Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9564 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
584fbc8f8b
commit
e4a9ce6db0
@ -44,7 +44,7 @@ class Attachment < ActiveRecord::Base
|
|||||||
"LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
|
"LEFT JOIN #{Project.table_name} ON #{Document.table_name}.project_id = #{Project.table_name}.id"}
|
||||||
|
|
||||||
cattr_accessor :storage_path
|
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
|
before_save :files_to_final_location
|
||||||
after_destroy :delete_from_disk
|
after_destroy :delete_from_disk
|
||||||
@ -125,7 +125,7 @@ class Attachment < ActiveRecord::Base
|
|||||||
|
|
||||||
# Returns file's location on disk
|
# Returns file's location on disk
|
||||||
def diskfile
|
def diskfile
|
||||||
"#{@@storage_path}/#{self.disk_filename}"
|
File.join(self.class.storage_path, disk_filename.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def increment_download
|
def increment_download
|
||||||
|
Loading…
x
Reference in New Issue
Block a user