Skip to content

Instantly share code, notes, and snippets.

View byroot's full-sized avatar

Jean Boussier byroot

View GitHub Profile
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)
end
else
require 'spec_helper'
describe User do
it{ should have_field(:email).of_type(String) }
it{ should have_field(:username).of_type(String) }
it{ should have_field(:password_hash).of_type(String) }
it{ should have_field(:password_salt).of_type(String) }
it{ should have_field(:activation_token).of_type(String) }