app/controllers/catches_controller.rb
# If the user is competing in multiple competitions, make sure he has indicated
# which competition this catch is for.
If the user is competing in multiple competitions, make sure he has indicated
which competition this catch is for.
If the user is competing in multiple competitions make sure he has indicated which competition this catch is for .
def check_catch_params
    return if current_user.competitions.active.count == 1
    return if catch_params.present?
    redirect_to :back,
                alert: 'Select a competition BEFORE adding a catch. If no competitions exist yet, add one, then add a catch.'
  end
def check_catch_params return if current_user . competitions . active . count == 1 return if catch_params . present? redirect_to :back , alert : 'Select a competition BEFORE adding a catch. If no competitions exist yet, add one, then add a catch.' end
If the user is competing in multiple competitions, make sure he has indicated
which competition this catch is for.
If the user is competing in multiple competitions make sure he has indicated which competition this catch is for .
# REVIEW: This will raise an exception. Figure out the best way to handle it