Migrated to rails 4