adapted rails version