From 060416d20c9f1442f4ab3c1ca7ae0e490686c951 Mon Sep 17 00:00:00 2001 From: Thiago Youssef Date: Mon, 16 May 2022 13:55:33 +0300 Subject: [PATCH] Use validation event constants --- app/interactions/actions/email_check.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/interactions/actions/email_check.rb b/app/interactions/actions/email_check.rb index 0f3ca52a1f..f83f2dd2c5 100644 --- a/app/interactions/actions/email_check.rb +++ b/app/interactions/actions/email_check.rb @@ -36,11 +36,11 @@ def destroy_old_validations(validation_events, minimum_size) def filtering_old_failed_records(result) events = validation_eventable.validation_events - destroy_old_validations(events, 3) if @check_level == 'mx' && !result.success + destroy_old_validations(events, ValidationEvent::MX_CHECK) if @check_level == 'mx' && !result.success - destroy_old_validations(events, 1) if @check_level == 'mx' && result.success + destroy_old_validations(events, ValidationEvent::REDEEM_EVENTS_COUNT_BY_LEVEL[:mx]) if @check_level == 'mx' && result.success - destroy_old_validations(events, 1) if @check_level == 'smtp' + destroy_old_validations(events, ValidationEvent::REDEEM_EVENTS_COUNT_BY_LEVEL[:smtp]) if @check_level == 'smtp' end def save_result(result)