title: Ruby on Rails - Emoji not saved in MySQL
body: <p>I'm working on a Rails app where users can upload photos to their profiles. Every photo has a title, which is supposed to support emoji. Despite changing encoding of the table to <em>utf8mb4</em> and modifying <em>database.yml</em> when i try to save a photo with emoji in its title MySQL returns an error 'incorrect string value'.</p>
  
  <p>The app is working on Rails 5.0.0.1 with Ruby 2.3.0, MySQL is working on version 5.7.16.</p>
  
  <p>Migration file:</p>
  
  <pre><code>class CreateUserPhotos &lt; ActiveRecord::Migration[5.0]
    def change
      create_table :user_photos do |t|
        t.string  :title
        t.string  :filename, null: false
        t.integer :visibility, null: false, default: 0
        t.belongs_to :user, foreign_key: true, index: true
  
        t.timestamps
      end
  
      reversible do |dir|
        dir.up do
          execute "ALTER TABLE `user_photos` CHANGE `title` `title` VARCHAR(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
        end
  
        dir.down do
          execute "ALTER TABLE `user_photos` CHANGE `title` `title` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci;"
        end
      end
    end
  end
  </code></pre>
  
  <p>database.yml file:</p>
  
  <pre><code>production:
    adapter: mysql2
    encoding: utf8mb4
    reconnect: false
    database: app_db
    pool: 5
    username: app_user
    password: app_password
    host: localhost
    socket: /var/run/mysqld/mysqld.sock
    collation: utf8mb4_unicode_ci
  </code></pre>