Skip to content

Instantly share code, notes, and snippets.

CarrierWave.configure do |config|
config.fog_directory = Rails.env.production? ? "web.com" : "staging.web.com"
config.asset_host = Rails.application.secrets.aws['asset_host']
fog_credentials = {
:provider => 'AWS',
:region => Rails.application.secrets.aws['region'],
:path_style => true,
:endpoint => "https://s3-ap-southeast-1.amazonaws.com"
}
@krukgit
krukgit / character_set_and_collation.rb
Last active September 2, 2015 10:42 — forked from tjh/character_set_and_collation.rb
Convert all Rails table column collation and character set.
DATABASE = ''
CHARACTER_SET = 'utf8'
COLLATION = 'utf8_general_ci'
schema = File.open('db/schema.rb', 'r').read
rows = schema.split("\n")
table_name = nil
rows.each do |row|
if row =~ /create_table/