removed orig file and also began encryption related stuff for ssn(s)
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
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
|
|
||||||
=======
|
|
||||||
def self.make_backup(file, data_path, full_file_name)
|
|
||||||
if File.exists?(full_file_name)
|
|
||||||
system("cp #{full_file_name} #{data_path}/bak#{Time.now.to_i}_#{file.original_filename}")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
>>>>>>> bd066068ff2fd63a0edeede010167cfa63a03aff
|
|
||||||
|
|
||||||
=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
|
|
||||||
=end
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -8,10 +8,14 @@ class WorkInfo < ActiveRecord::Base
|
|||||||
"***-**-" << self.SSN[-4,4]
|
"***-**-" << self.SSN[-4,4]
|
||||||
end
|
end
|
||||||
|
|
||||||
def encrypt_ssn
|
def encrypt_ssn(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def decrypt_ssn
|
def decrypt_ssn(encrypted_data)
|
||||||
|
end
|
||||||
|
|
||||||
|
def cipher_mode
|
||||||
|
'aes-256-cbc'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user