vendredi 19 septembre 2014

Sorting the 10 highest projects alphabetically with ActiceRecord


Vote count:

0




I have the following statement that returns the 10 highest projects.



Timesheet.joins(:project).select('projects.name as name, SUM(value) AS Minutes').group('projects.name').order('Minutes DESC').limit(10)


How can I order them alphabetically? I tried putting .order('name') behind the statement but that doesn't work.



asked 50 secs ago

rept

308






Sorting the 10 highest projects alphabetically with ActiceRecord

Aucun commentaire:

Enregistrer un commentaire