Skip to content

Instantly share code, notes, and snippets.

View Navinnair's full-sized avatar
😇

Navin Nair Kottayil Navinnair

😇
View GitHub Profile
require 'yaml'
dbconfig = YAML::load(File.open('config/database.yml'))
tables_to_export = %w[ users students ]
destination_folder = 'tmp'
db_conf = 'config/database.yml'
db = YAML::load(File.open( db_conf ))["production"]
tables_to_export.each do |table|
dest_file = File.join( destination_folder, "#{table}.csv" )