1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Reducing queries for up_matches on mat model

This commit is contained in:
2015-11-02 11:58:51 -05:00
parent e79482fd07
commit f14fbadfd1

View File

@@ -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