web/app/models/benchmark_info.rb
changeset 306 8050d8d3681f
parent 303 ce55fabc46a0
--- a/web/app/models/benchmark_info.rb	Tue Nov 17 15:02:56 2015 +0100
+++ b/web/app/models/benchmark_info.rb	Tue Nov 17 15:05:38 2015 +0100
@@ -19,11 +19,10 @@
   end
 
   def latest_result_for_configuration(configuration)
-    benchmark_results.
-      for_configuration_id(configuration.id).
-      with_batch_and_duration_preloaded.
-      newest_first.
-      first
+    benchmark_results
+      .select { |r| r.benchmark_batch.benchmark_configuration_id == configuration.id }
+      .sort { |r, s| r.performed_at <=> s.performed_at }
+      .first
   end
 
 end