app/controllers/api/v1/meetings_controller.rb
# Prepares the result list for the result hash of #show() given the list of
# Meeting Events +mevs_list+.
#
Prepares the result list for the result hash of #show() given the list of
Meeting Events +mevs_list+.
Prepares the result list for the result hash of #show () given the list of Meeting Events + mevs_list + .
def prepare_result_list( mevs_list )
    mevs_list.map do |event|
      {
        id:         event.id,
        name:       event.event_type.i18n_short,
        date:       event.get_scheduled_date,
        progs: event.meeting_programs.includes(:category_type, :gender_type)
          .order('category_types.age_begin').map do |prog|
             {
               id:       prog.id,
               category: prog.category_type.get_short_name,
               gender:   prog.gender_type.code,
               mirs:  prog.meeting_individual_results.includes(:swimmer, :team)
                        .map do |mir|
                          mir = mir.decorate
                          {
                            id:           mir.id,
                            swimmer:      mir.get_swimmer_name,
                            swimmer_year: mir.get_year_of_birth,
                            team:         mir.get_team_name,
                            timing:       mir.get_timing,
                            rank:         mir.get_rank_description,
                            rank_valid:   mir.is_valid_for_ranking,
                            passages:     mir.get_passages
                                            .map do |passage|
                                              {
                                                id:       passage.id,
                                                distance: passage.get_passage_distance,
                                                timing:   passage.get_timing,
                                                label:    passage.get_short_name
                                              }
                                            end,
                            std_points:   mir.get_formatted_standard_points,
                            ind_points:   mir.get_formatted_individual_points
                          }
                        end,
               mrr:  prog.meeting_relay_results.includes(:team)
                        .map do |mrr|
                          mrr = mrr.decorate
                          {
                            id:           mrr.id,
                            team:         mrr.get_team_name,
                            timing:       mrr.get_timing,
                            rank:         mrr.get_rank_description,
                            rank_valid:   mrr.is_valid_for_ranking,
                            std_points:   mrr.get_formatted_standard_points,
                            met_points:   mrr.get_formatted_meeting_points
                          }
                        end,
               entries:  prog.meeting_entries
                        .map do |entry|
                          {
                            id:                 entry.id,
                            swimmer:            entry.get_swimmer_name,
                            swimmer_year:       entry.get_year_of_birth,
                            team:               entry.get_team_name,
                            timing:             entry.get_timing,
                            start_list_number:  entry.start_list_number,
                            lane_number:        entry.lane_number,
                            heat_number:        entry.heat_number,
                            is_no_time:         entry.is_no_time
                          }
                        end
             }
          end
      }
    end
  end
def prepare_result_list ( mevs_list ) mevs_list . map do | event | { id : event . id , name : event . event_type . i18n_short , date : event . get_scheduled_date , progs : event . meeting_programs . includes ( :category_type , :gender_type ) . order ( 'category_types.age_begin' ) . map do | prog | { id : prog . id , category : prog . category_type . get_short_name , gender : prog . gender_type . code , mirs : prog . meeting_individual_results . includes ( :swimmer , :team ) . map do | mir | mir = mir . decorate { id : mir . id , swimmer : mir . get_swimmer_name , swimmer_year : mir . get_year_of_birth , team : mir . get_team_name , timing : mir . get_timing , rank : mir . get_rank_description , rank_valid : mir . is_valid_for_ranking , passages : mir . get_passages . map do | passage | { id : passage . id , distance : passage . get_passage_distance , timing : passage . get_timing , label : passage . get_short_name } end , std_points : mir . get_formatted_standard_points , ind_points : mir . get_formatted_individual_points } end , mrr : prog . meeting_relay_results . includes ( :team ) . map do | mrr | mrr = mrr . decorate { id : mrr . id , team : mrr . get_team_name , timing : mrr . get_timing , rank : mrr . get_rank_description , rank_valid : mrr . is_valid_for_ranking , std_points : mrr . get_formatted_standard_points , met_points : mrr . get_formatted_meeting_points } end , entries : prog . meeting_entries . map do | entry | { id : entry . id , swimmer : entry . get_swimmer_name , swimmer_year : entry . get_year_of_birth , team : entry . get_team_name , timing : entry . get_timing , start_list_number : entry . start_list_number , lane_number : entry . lane_number , heat_number : entry . heat_number , is_no_time : entry . is_no_time } end } end } end end
Prepares the result list for the result hash of #show() given the list of
Meeting Events +mevs_list+.
Prepares the result list for the result hash of #show () given the list of Meeting Events + mevs_list + .
# MeetingIndividualResult array: # MeetingRelayResult array: # MeetingEntries array (no decorator for MeetingEntry):
mevs_list
<not_specific>