From https://github.com/Ritesh-Kumar/rails4_mysql_mongo