fix default sorting by primary key on ruby 1.8