app/models/submission.rb
# Delete all records of filename in submissions and store in backup folder
# (for now, called "BACKUP")
Delete all records of filename in submissions and store in backup folder
(for now, called "BACKUP")
Delete all records of filename in submissions and store in backup folder ( for now called " BACKUP " )
def remove_file(filename)
    files = submission_files.where(filename: filename)
    return if files.blank?
    files.each(&:destroy)  
    adir = submit_dir
    backup_dir = File.join(adir, 'BACKUP')
    FileUtils.mkdir_p(backup_dir)
    source_file = File.join(adir, filename)
    dest_file = File.join(backup_dir, filename)
    FileUtils.mv(source_file, dest_file, force: true)
  end
def remove_file ( filename ) files = submission_files . where ( filename : filename ) return if files . blank? files . each ( & :destroy ) adir = submit_dir backup_dir = File . join ( adir , 'BACKUP' ) FileUtils . mkdir_p ( backup_dir ) source_file = File . join ( adir , filename ) dest_file = File . join ( backup_dir , filename ) FileUtils . mv ( source_file , dest_file , force : true ) end
Delete all records of filename in submissions and store in backup folder
(for now, called "BACKUP")
Delete all records of filename in submissions and store in backup folder ( for now called " BACKUP " )
# get all submissions for this filename # destroy all records first
filename
<not_specific>