app/dao/swimmer_stats_dao.rb
# Check for completed iron masters
# Iron master is completed if in the same MASFIN season there are valid results for 18 different event types
#

Check for completed iron masters
Iron master is completed if in the same MASFIN season there are valid results for 18 different event types
Check for completed iron masters Iron master is completed if in the same MASFIN season there are valid results for 18 different event types
def count_iron_masters
    iron_masters_count = 0
    @fin_mirs.collect{ |mir| mir.badge_id }.uniq.each do |fin_badge|
      iron_masters_count += 1 if @fin_mirs.reject{ |mir| mir.badge_id != fin_badge }.collect{ |mir| mir.event_type_code }.uniq.count >= 18
    end
    iron_masters_count
  end
def count_iron_masters iron_masters_count = 0 @fin_mirs . collect { | mir | mir . badge_id } . uniq . each do | fin_badge | iron_masters_count += 1 if @fin_mirs . reject { | mir | mir . badge_id != fin_badge } . collect { | mir | mir . event_type_code } . uniq . count >= 18 end iron_masters_count end
Check for completed iron masters
Iron master is completed if in the same MASFIN season there are valid results for 18 different event types
Check for completed iron masters Iron master is completed if in the same MASFIN season there are valid results for 18 different event types