Web: Sort benchmarks in result table
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 21 Mar 2016 17:13:58 +0000
changeset 313 fc9e1fcac1b3
parent 312 c9a8fa71d8fc
child 315 e08b96365d76
Web: Sort benchmarks in result table ...by name.
web/app/views/index/_benchmarks_table.html.erb
--- a/web/app/views/index/_benchmarks_table.html.erb	Fri Mar 18 22:41:49 2016 +0000
+++ b/web/app/views/index/_benchmarks_table.html.erb	Mon Mar 21 17:13:58 2016 +0000
@@ -10,7 +10,11 @@
       </tr>
     </thead>
     <tbody>
-      <% batch.benchmark_results.each do |result| %>
+      <%
+      	results = batch.benchmark_results.to_a
+      	results.sort! { | a, b | a.benchmark_info.name <=> b.benchmark_info.name }
+      %>
+      <% results.each do |result| %>
         <tr>
           <th><%= result.benchmark_info.name %></th>
           <td><%= result.min_duration %></td>