app/controllers/teams_controller.rb
# Radiography for a specified team id: "Current Swimmers" tab rendering
#
# == Params:
# id: the team id to be processed
#
# header_year: typically nil, it's a current date override for when checking
#      for @swimmer badges in current season (mainly used only inside specs
#      to test a couple of edge conditions)
#
Radiography for a specified team id: "Current Swimmers" tab rendering
Params:
id: the team id to be processed

typically nil, it's a current date override for when checking
for @swimmer badges in current season (mainly used only inside specs
to test a couple of edge conditions)
Radiography for a specified team id : " Current Swimmers " tab rendering Params : id : the team id to be processed typically nil it ' s a current date override for when checking for @swimmer badges in current season ( mainly used only inside specs to test a couple of edge conditions )
def current_swimmers
    params.permit! 
    @tab_title = I18n.t('radiography.team_current_swimmers_tab')
    tcs = TeamCurrentSwimmers.new( @team )
    tcs.retrieve_data
    @current_swimmers = tcs.set_team_current_swimmers_dao
    @swimmers = @current_swimmers.swimmers
    @max_updated_at = @current_swimmers.updated_at
    @is_valid_team_manager = TeamManagerValidator.can_manage_team?( current_user, @team )
    @manageable_seasons_options = Season.is_not_ended
                                        .order(:description)
                                        .map { |season| [season.description, season.id] } if @is_valid_team_manager
     @last_seasons = Season.where("INSTR(header_year, {Date.today.year.to_s}) > 0")
     @manageable_seasons_options = Season.where("INSTR(header_year, {Date.today.year.to_s}) > 0")
                                         .order(:description)
                                         .map { |season| [season.description, season.id] } if @is_valid_team_manager
  end
def current_swimmers params . permit! @tab_title = I18n . t ( 'radiography.team_current_swimmers_tab' ) tcs = TeamCurrentSwimmers . new ( @team ) tcs . retrieve_data @current_swimmers = tcs . set_team_current_swimmers_dao @swimmers = @current_swimmers . swimmers @max_updated_at = @current_swimmers . updated_at @is_valid_team_manager = TeamManagerValidator . can_manage_team? ( current_user , @team ) @manageable_seasons_options = Season . is_not_ended . order ( :description ) . map { | season | [ season . description , season . id ] } if @is_valid_team_manager end
Radiography for a specified team id: "Current Swimmers" tab rendering
 Params:
id: the team id to be processed
Radiography for a specified team id : " Current Swimmers " tab rendering Params : id : the team id to be processed
# (No unsafe params are possible) #@last_seasons = get_searched_seasons #@affiliations = @team.team_affiliations.includes(season: :federation_type).where(season_id: @last_seasons) #current_badges = @team.badges.where(season_id: @last_seasons).includes( :swimmer ) if @last_seasons && @team.badges.exists? #@swimmers = if current_badges.nil? #  [] #else #  current_badges.map{ |badge| badge.swimmer }.uniq.sort{ |a,b| a.get_full_name <=> b.get_full_name } #end #@max_updated_at = @swimmers.size > 0 ? current_badges.order(updated_at: :desc).first.updated_at : 0 # Badge management entry point, only for Team Managers: # Before the start of a new Season and after last Season's end, the following # versions can be used to allow pre-filtering & management based even on the just-ended # seasons: (just looks at the current year) # # @last_seasons = Season.where("INSTR(header_year, #{Date.today.year.to_s}) > 0") # @manageable_seasons_options = Season.where("INSTR(header_year, #{Date.today.year.to_s}) > 0") #                                     .order(:description) #                                     .map { |season| [season.description, season.id] } if @is_valid_team_manager