Upgrade for rails4