Complete migration from PHP to Rails