app/models/concerns/schedulable.rb
# Looks up a registered check for a given schedule. If multiple checks are associated with the given schedule, returns
# the "deepest" such check.
#
# @param schedule [String] the schedule whose check you wish to retrieve
# @return [String, nil] the relevant check for the passed-in schedule, or nil if no such check exists
Looks up a registered check for a given schedule. If multiple checks are associated with the given schedule, returns
the "deepest" such check.
Looks up a registered check for a given schedule . If multiple checks are associated with the given schedule returns the " deepest " such check .
def relevant_check_for_schedule(schedule)
    schedules
      .select { |_, value| value == schedule.to_s }
      .map(&:first)
      .min_by { |check| CHECKS.index(check) }
  end
def relevant_check_for_schedule ( schedule ) schedules . select { | _ , value | value == schedule . to_s } . map ( & :first ) . min_by { | check | CHECKS . index ( check ) } end
Looks up a registered check for a given schedule.
Looks up a registered check for a given schedule .
the relevant check for the passed-in schedule, or nil if no such check exists
the relevant check for the passed - in schedule or nil if no such check exists
String, nil
schedule
the schedule whose check you wish to retrieve
the schedule whose check you wish to retrieve