app/logical/bigquery_export_service.rb
# Dump the table's records to a gzipped, newline-delimited JSON tempfile.
Dump the table's records to a gzipped, newline-delimited JSON tempfile.
Dump the table ' s records to a gzipped newline - delimited JSON tempfile .
def dump_records!
    file = Tempfile.new("danbooru-export-dump-", binmode: true)
    file = Zlib::GzipWriter.new(file)
    CurrentUser.scoped(User.anonymous) do
      records.find_each(batch_size: 5_000) do |record|
        file.puts(record.to_json)
      end
    end
    file.close 
    file
  end
def dump_records! file = Tempfile . new ( "danbooru-export-dump-" , binmode : true ) file = Zlib :: GzipWriter . new ( file ) CurrentUser . scoped ( User . anonymous ) do records . find_each ( batch_size : 5_000 ) do | record | file . puts ( record . to_json ) end end file . close file end
Dump the table's records to a gzipped, newline-delimited JSON tempfile.
Dump the table ' s records to a gzipped newline - delimited JSON tempfile .
# flush zlib footer