diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 74f672b962..8938f35db6 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -323,12 +323,10 @@ def do_generate_public_export end def check_regional_records - refresh_index_param = params[:refresh_index] || nil - @check_records_request = CheckRegionalRecordsForm.new( competition_id: params[:competition_id] || nil, event_id: params[:event_id] || nil, - refresh_index: ActiveRecord::Type::Boolean.new.cast(refresh_index_param) || false, + refresh_index: params[:refresh_index] || nil, ) @cad_timestamp = ComputeAuxiliaryData.successful_start_date&.to_fs || 'never' diff --git a/app/models/check_regional_records_form.rb b/app/models/check_regional_records_form.rb index acb2421ed2..da4488ae23 100644 --- a/app/models/check_regional_records_form.rb +++ b/app/models/check_regional_records_form.rb @@ -9,8 +9,12 @@ def check_event_id self.event_id == 'all' ? nil : self.event_id end + def refresh_index? + ActiveRecord::Type::Boolean.new.cast(self.refresh_index) || false + end + def run_check - if self.refresh_index && self.competition_id.present? + if self.refresh_index? && self.competition_id.present? CheckRegionalRecords.add_to_lookup_table(self.competition_id) end