app/controllers/championships_controller.rb
# CSI regional ER all times records
# CSI ER Regional records doesn't need category split or join
#
CSI regional ER all times records
CSI ER Regional records doesn't need category split or join
CSI regional ER all times records CSI ER Regional records doesn ' t need category split or join
def records_regional_er_csi
    @title = I18n.t('championships.records') + ' ' + @season_type.get_full_name
    @recordDAO = RecordX4DAO.new( @season_type, RecordType.find_by_code( 'FOR' ) )
    IndividualRecord.
     joins(:record_type, season: :season_type).
     where("record_types.code = 'FOR' and season_types.code = 'MASCSI'", ).
     includes(:swimmer, :category_type, :gender_type, :pool_type, :event_type, [meeting_individual_result: [meeting_program: [meeting_event: [meeting_session: :meeting]]]]).
     each do |record|
      if !record.category_type.is_undivided
        @recordDAO.add_record(
         record.meeting_individual_result,
         record.category_type,
         record.pool_type,
         record.gender_type,
         record.event_type,
         record.swimmer
        )
        @max_updated_at = record.updated_at if @max_updated_at.nil? || @max_updated_at < record.updated_at
      end
    end
    @highlight_swimmer_id = current_user.swimmer_id if current_user
  end
def records_regional_er_csi @title = I18n . t ( 'championships.records' ) + ' ' + @season_type . get_full_name @recordDAO = RecordX4DAO . new ( @season_type , RecordType . find_by_code ( 'FOR' ) ) IndividualRecord . joins ( :record_type , season : :season_type ) . where ( "record_types.code = 'FOR' and season_types.code = 'MASCSI'" , ) . includes ( :swimmer , :category_type , :gender_type , :pool_type , :event_type , [ meeting_individual_result : [ meeting_program : [ meeting_event : [ meeting_session : :meeting ] ] ] ] ) . each do | record | if ! record . category_type . is_undivided @recordDAO . add_record ( record . meeting_individual_result , record . category_type , record . pool_type , record . gender_type , record . event_type , record . swimmer ) @max_updated_at = record . updated_at if @max_updated_at . nil? || @max_updated_at < record . updated_at end end @highlight_swimmer_id = current_user . swimmer_id if current_user end
CSI regional ER all times records
CSI ER Regional records doesn't need category split or join
CSI regional ER all times records CSI ER Regional records doesn ' t need category split or join
# Prepare record DAO # Add records #joins(:swimmer, :category_type, :gender_type, :pool_type, :event_type, [meeting_individual_result: [meeting_program: [meeting_event: [meeting_session: :meeting]]]], season: :season_type). #includes(:swimmer, :category_type, :gender_type, :pool_type, :event_type, :meeting_individual_result). #for_season_type( @season_type.id ).where( gender_type: 1, pool_type: 1 ).limit(50). #where( gender_type: 1, pool_type: 1 ). # TODO # Manage the fucking 50 specials...