Skip to content

Commit

Permalink
optimize sql
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Jul 27, 2023
1 parent 4ff0399 commit eb4f79b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def lookup_most_recent_cases
end

# map to objects
most_recent_cases = Case.includes(:tries).where(id: [ case_ids ])
most_recent_cases = Case.includes([:scorer,:scores]).where(id: [ case_ids ])
most_recent_cases = most_recent_cases.select { |kase| !kase.last_score.blank? }
most_recent_cases = most_recent_cases.sort_by { |x| x.case_name }
most_recent_cases
Expand Down

0 comments on commit eb4f79b

Please sign in to comment.