Fix broken Distinct relations
Fix broken Distinct relations

If relation contains -> { distinct } and we use target models
instead of ids, then the search query contains distinct too.
But since we use order_by lower(col_name) and we do not put
that expression into the select, the sql query fails.

Using ids is not putting distinct into the query, but the result
is distinct by default.

NaNi-Z/manageiq,ailisp/manageiq,josejulio/manageiq,fbladilo/manageiq,tinaafitz/manageiq,juliancheal/manageiq,NickLaMuro/manageiq,mresti/manageiq,jrafanie/manageiq,djberg96/manageiq,jntullo/manageiq,gerikis/manageiq,chessbyte/manageiq,KevinLoiseau/manageiq,branic/manageiq,gmcculloug/manageiq,jvlcek/manageiq,aufi/manageiq,lpichler/manageiq,gmcculloug/manageiq,juliancheal/manageiq,yaacov/manageiq,israel-hdez/manageiq,mkanoor/manageiq,romaintb/manageiq,hstastna/manageiq,ilackarms/manageiq,mzazrivec/manageiq,KevinLoiseau/manageiq,maas-ufcg/manageiq,billfitzgerald0120/manageiq,KevinLoiseau/manageiq,yaacov/manageiq,matobet/manageiq,agrare/manageiq,ilackarms/manageiq,chessbyte/manageiq,andyvesel/manageiq,mkanoor/manageiq,tinaafitz/manageiq,pkomanek/manageiq,israel-hdez/manageiq,josejulio/manageiq,israel-hdez/manageiq,matobet/manageiq,agrare/manageiq,mzazrivec/manageiq,andyvesel/manageiq,gerikis/manageiq,tinaafitz/manageiq,gerikis/manageiq,aufi/manageiq,andyvesel/manageiq,agrare/manageiq,romanblanco/manageiq,kbrock/manageiq,billfitzgerald0120/manageiq,syncrou/manageiq,josejulio/manageiq,mresti/manageiq,ManageIQ/manageiq,billfitzgerald0120/manageiq,durandom/manageiq,mfeifer/manageiq,romaintb/manageiq,maas-ufcg/manageiq,branic/manageiq,ManageIQ/manageiq,NickLaMuro/manageiq,NickLaMuro/manageiq,djberg96/manageiq,durandom/manageiq,maas-ufcg/manageiq,jntullo/manageiq,yaacov/manageiq,agrare/manageiq,d-m-u/manageiq,gerikis/manageiq,matobet/manageiq,skateman/manageiq,jameswnl/manageiq,mkanoor/manageiq,mzazrivec/manageiq,borod108/manageiq,yaacov/manageiq,syncrou/manageiq,skateman/manageiq,mzazrivec/manageiq,romaintb/manageiq,tzumainn/manageiq,NaNi-Z/manageiq,andyvesel/manageiq,NaNi-Z/manageiq,romaintb/manageiq,juliancheal/manageiq,jrafanie/manageiq,durandom/manageiq,pkomanek/manageiq,aufi/manageiq,ManageIQ/manageiq,borod108/manageiq,hstastna/manageiq,mresti/manageiq,djberg96/manageiq,KevinLoiseau/manageiq,lpichler/manageiq,romanblanco/manageiq,jvlcek/manageiq,jvlcek/manageiq,billfitzgerald0120/manageiq,mfeifer/manageiq,jntullo/manageiq,maas-ufcg/manageiq,ilackarms/manageiq,skateman/manageiq,tzumainn/manageiq,branic/manageiq,jrafanie/manageiq,gmcculloug/manageiq,d-m-u/manageiq,chessbyte/manageiq,tzumainn/manageiq,lpichler/manageiq,jameswnl/manageiq,borod108/manageiq,pkomanek/manageiq,hstastna/manageiq,jntullo/manageiq,mfeifer/manageiq,aufi/manageiq,NickLaMuro/manageiq,ailisp/manageiq,romanblanco/manageiq,ManageIQ/manageiq,josejulio/manageiq,jvlcek/manageiq,fbladilo/manageiq,d-m-u/manageiq,syncrou/manageiq,tinaafitz/manageiq,juliancheal/manageiq,chessbyte/manageiq,branic/manageiq,romaintb/manageiq,matobet/manageiq,mresti/manageiq,syncrou/manageiq,ailisp/manageiq,israel-hdez/manageiq,NaNi-Z/manageiq,kbrock/manageiq,jameswnl/manageiq,KevinLoiseau/manageiq,hstastna/manageiq,romanblanco/manageiq,jameswnl/manageiq,fbladilo/manageiq,lpichler/manageiq,mkanoor/manageiq,djberg96/manageiq,ilackarms/manageiq,pkomanek/manageiq,kbrock/manageiq,skateman/manageiq,maas-ufcg/manageiq,gmcculloug/manageiq,d-m-u/manageiq,fbladilo/manageiq,jrafanie/manageiq,romaintb/manageiq,KevinLoiseau/manageiq,durandom/manageiq,kbrock/manageiq,ailisp/manageiq,mfeifer/manageiq,tzumainn/manageiq,maas-ufcg/manageiq,borod108/manageiq