app/strategies/swimmer_presence_checker.rb
# Check if the swimmer has attended the given meeting
# The swimmer has attended when there is an entry or an individual result or a confirmed reservation
#
Check if the swimmer has attended the given meeting
The swimmer has attended when there is an entry or an individual result or a confirmed reservation
Check if the swimmer has attended the given meeting The swimmer has attended when there is an entry or an individual result or a confirmed reservation
def has_swimmer_attended_meeting?( meeting )
    has_attended = false
    if MeetingIndividualResult.joins( :meeting_session ).where( ['meeting_individual_results.swimmer_id = ? and meeting_sessions.meeting_id = ?', @swimmer.id, meeting.id] ).exists?
      has_attended = true
    elsif MeetingEntry.joins( :meeting_session ).where( ['meeting_entries.swimmer_id = ? and meeting_sessions.meeting_id = ?', @swimmer.id, meeting.id] ).exists?
      has_attended = true
    elsif MeetingReservation.is_coming.where( ['has_confirmed and swimmer_id = ? and meeting_id = ?', @swimmer.id, meeting.id] ).exists?
      has_attended = true
    end
    has_attended
  end
def has_swimmer_attended_meeting? ( meeting ) has_attended = false if MeetingIndividualResult . joins ( :meeting_session ) . where ( [ 'meeting_individual_results.swimmer_id = ? and meeting_sessions.meeting_id = ?' , @swimmer . id , meeting . id ] ) . exists? has_attended = true elsif MeetingEntry . joins ( :meeting_session ) . where ( [ 'meeting_entries.swimmer_id = ? and meeting_sessions.meeting_id = ?' , @swimmer . id , meeting . id ] ) . exists? has_attended = true elsif MeetingReservation . is_coming . where ( [ 'has_confirmed and swimmer_id = ? and meeting_id = ?' , @swimmer . id , meeting . id ] ) . exists? has_attended = true end has_attended end
Check if the swimmer has attended the given meeting
The swimmer has attended when there is an entry or an individual result or a confirmed reservation
Check if the swimmer has attended the given meeting The swimmer has attended when there is an entry or an individual result or a confirmed reservation
# Check for meeting individual results # Check for meeting entries # Check for confirmed reservation
meeting
<not_specific>