Merge pull request #123 from raesene/patch-1

Update benefits.rb accept binary file types.
This commit is contained in:
Ken Johnson
2014-05-22 12:59:10 -06:00
+1 -1
View File
@@ -4,7 +4,7 @@ class Benefits < ActiveRecord::Base
def self.save(file, backup=false) def self.save(file, backup=false)
data_path = Rails.root.join("public", "data") data_path = Rails.root.join("public", "data")
full_file_name = "#{data_path}/#{file.original_filename}" full_file_name = "#{data_path}/#{file.original_filename}"
f = File.open(full_file_name, "w+") f = File.open(full_file_name, "wb+")
f.write file.read f.write file.read
f.close f.close
make_backup(file, data_path, full_file_name) if backup == "true" make_backup(file, data_path, full_file_name) if backup == "true"