database-independent sorting queries
generates urls correctly under rails 4
Merge branch 'refs/heads/helper_url_generation'