app/models/data_search_file.rb
# TODO - we /might/ want to add the utf-8 BOM here to ease opening the file
# for users of Excel. q.v.:
# http://stackoverflow.com/questions/9886705/how-to-write-bom-marker-to-a-file-in-ruby
we /might/ want to add the utf-8 BOM here to ease opening the file
for users of Excel.
we / might / want to add the utf - 8 BOM here to ease opening the file for users of Excel .
def write_file
    rows = get_data
    col_heads = get_headers(rows)
    CSV.open(local_file_path, 'wb') do |csv|
      csv_builder(csv, col_heads, rows)
    end
    update_attributes(row_count: rows.count, failed_at: nil, error: nil)
  end
def write_file rows = get_data col_heads = get_headers ( rows ) CSV . open ( local_file_path , 'wb' ) do | csv | csv_builder ( csv , col_heads , rows ) end update_attributes ( row_count : rows . count , failed_at : nil , error : nil ) end
TODO - we /might/ want to add the utf-8 BOM here to ease opening the file
for users of Excel.
TODO - we / might / want to add the utf - 8 BOM here to ease opening the file for users of Excel .