Updated to use rails 4