Rhom: Sorting a column after making all values to down case, but output as the original with case preserved

38 Views Asked by At

I have been trying to sort the output of select query based upon one column as like this,

users = User.find(:all, :select => ['name'], :order => ["name"], :orderdir => ["ASC"], :conditions => {:deleted => 'false'})

But this sorts the list based upon the case separately and giving below output,

Ashis
Ram
lucky
syam

Which should be like this

Ashis
lucky
Ram
syam

So i tried this way and got the output

users = User.find_by_sql("select name from user where deleted = 'false' order by lower(name) ASC")

I'm just wondering the way to achieve this using .find. How to do so ?

0

There are 0 best solutions below