I have a instance method called entry_sum which sums a few other instance methods.
...
def game4sum
if games[3] and games[3].winning_team_id == game4_selection
then 1
else 0
end
end
def entry_sum
game1sum + game2sum + game3sum + game4sum
end
In my view I'm running
<% @entries.each do |entry| %>
...
<%= entry.entry_sum %>
My question is, is it possible to then find the max value for entry_sum if there are X amount of entries in @entries? I'm looking to identify the entry with the highest value for entry_sum. This is my first app and I have a feeling that I need to restructure/visit class vs instance methods.