You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/models/attachment_history.rb

15 lines
467 B

class AttachmentHistory < ActiveRecord::Base
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