Update for rails 4