mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-01 20:25:26 +00:00
Reducing queries for up_matches on mat model
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user