Skip to content

Instantly share code, notes, and snippets.

@thatrubylove
Created May 7, 2015 03:38
Show Gist options
  • Save thatrubylove/69b28ba5cb0f5813f8d7 to your computer and use it in GitHub Desktop.
Save thatrubylove/69b28ba5cb0f5813f8d7 to your computer and use it in GitHub Desktop.
#!ruby
# config/initializers/mysql_utf8mb4_fix.rb
require 'active_record/connection_adapters/abstract_mysql_adapter'
module ActiveRecord
module EmojiConnectionAdapters
refine AbstractMysqlAdapter do
NATIVE_DATABASE_TYPES[:string] = { name: "varchar", limit: 191 }
end
end
module ConnectionAdapters
using EmojiConnectionAdapters
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment