adds autojoin option to #sort scope method to (de-)activate left joining of associated tables when needed, adds more tests