Upgrades to rails 4