Skip to content

Commit

Permalink
wip shrimpo mega trophies
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfiredrill committed Oct 2, 2024
1 parent d2ae827 commit e3a6512
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/shrimpo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ def tally_results!
self.shrimpo_entries.each do |entry|
total_score = entry.shrimpo_votes.sum(:score)
entry.update! total_score: total_score

if self.mega?
self.shrimpo_voting_categories.each do |voting_category|
total = entry.shrimpo_votes.where(shrimpo_voting_category: voting_category).sum(:score)
# ShrimpoVotingCategoryScore.create entry: entry, shrimpo_voting_category: voting_category, score: total
end
# calculate score for each category
#
# create shrimpo_voting_category_score
end
end

self.shrimpo_entries.sort_by(&:total_score).reverse.each_with_index do |entry, index|
Expand Down

0 comments on commit e3a6512

Please sign in to comment.