update rails related code to 4.0