Skip to content

Instantly share code, notes, and snippets.

View tilo's full-sized avatar
👋

Tilo tilo

👋
View GitHub Profile
@tilo
tilo / convert.rake
Last active May 16, 2018 15:14 — forked from tboyko/convert.rake
namespace :db do
desc "convert a latin1 database with utf8 data into proper utf8"
task :convert_to_utf8 => :environment do
puts Time.now
dryrun = ENV['DOIT'] != '1'
conn = ActiveRecord::Base.connection
if dryrun
def conn.run_sql(sql)
puts(sql)