mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-06 06:28:33 +00:00
Reducing queries for up_matches on mat model
This commit is contained in:
@@ -10,7 +10,7 @@ class Mat < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unfinishedMatches
|
def unfinishedMatches
|
||||||
matches.where(finished: nil).order(:bout_number)
|
matches.select{|m| m.finished == nil}.sort_by{|m| m.bout_number}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user