<commit_before>class Benefits < ActiveRecord::Base
 attr_accessor :backup
 
 def self.save(file, backup=false)
   data_path = Rails.root.join("public", "data")
   full_file_name = "#{data_path}/#{file.original_filename}"
   f = File.open(full_file_name, "w+")
   f.write file.read
   f.close
   make_backup(file, data_path, full_file_name) if backup == "true"
 end
 
 def self.make_backup(file, data_path, full_file_name)
   system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}")
   # FileUtils.cp "#{full_file_name}", "#{data_path}/bak#{Time.now.to_i}_#{file.original_filename}"
 end

=begin 
 def self.make_backup(file, data_path, full_file_name)
   FileUtils.cp "#{full_file_name}", "#{data_path}/bak#{Time.now.to_i}_#{file.original_filename}"
 end<commit_msg>this seems to have fixed a nuisance error within our unit-tests. Issue #57<commit_after>class Benefits < ActiveRecord::Base
 attr_accessor :backup
 
 def self.save(file, backup=false)
   data_path = Rails.root.join("public", "data")
   full_file_name = "#{data_path}/#{file.original_filename}"
   f = File.open(full_file_name, "w+")
   f.write file.read
   f.close
   make_backup(file, data_path, full_file_name) if backup == "true"
 end
 
 def self.make_backup(*params)
    if File.exists?(full_file_name)
     system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}")
    end
  end

=begin 
  def self.make_backup(file, data_path, full_file_name)
    FileUtils.cp "#{full_file_name}", "#{data_path}/bak#{Time.now.to_i}_#{file.original_filename}"
  end
{'fraction_non_alphanumeric': 0.15097915350600127, 'fraction_numerical': 0.0012634238787113076, 'mean_word_length': 5.3107569721115535, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5287094', 'n_tokens_mistral': 582, 'n_tokens_neox': 579, 'n_words': 101}