Fix Rails 4.2 SerializationTypeMismatch