support rails version >3