MySQL configured with utf-8 encoding blows up when trying to save text rows containing emojis, etc., to address this, Demoji rescues from that specific exception and replaces the culprit chars with empty spaces.
This is a workaround until Rails adds support for UTF8MB4 in migrations, schema, etc.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install demoji
Write an initializer in:
ActiveRecord::Base.send :include, Demoji
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request