Previous attempt boned rails3, so convert to an if/else