parent
534d93de77
commit
a7470e059d
@ -1,3 +1,14 @@
|
|||||||
class AttachmentHistory < ActiveRecord::Base
|
class AttachmentHistory < ActiveRecord::Base
|
||||||
belongs_to :attachment,foreign_key: 'attachment_id'
|
belongs_to :attachment,foreign_key: 'attachment_id'
|
||||||
|
cattr_accessor :storage_history_path
|
||||||
|
@@storage_history_path = Redmine::Configuration['attachments_storage_path'] || File.join(Rails.root, "files")
|
||||||
|
|
||||||
|
# Returns file's location on disk
|
||||||
|
def diskfile_history
|
||||||
|
File.join(self.class.storage_history_path, disk_directory.to_s, disk_filename.to_s)
|
||||||
|
end
|
||||||
|
|
||||||
|
def increment_download
|
||||||
|
increment!(:downloads)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in new issue