From f14fbadfd101aa8103bd4b44ece031f086e27bda Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Mon, 2 Nov 2015 11:58:51 -0500 Subject: [PATCH] Reducing queries for up_matches on mat model --- app/models/mat.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/mat.rb b/app/models/mat.rb index 31ce709..d81fd19 100644 --- a/app/models/mat.rb +++ b/app/models/mat.rb @@ -10,7 +10,7 @@ class Mat < ActiveRecord::Base end def unfinishedMatches - matches.where(finished: nil).order(:bout_number) + matches.select{|m| m.finished == nil}.sort_by{|m| m.bout_number} end end