From ab3ababc1a139cc43c4cc6c684e91684efcee604 Mon Sep 17 00:00:00 2001 From: dinsmol Date: Wed, 23 Feb 2022 00:17:18 +0300 Subject: [PATCH] Fix codeclimate errors --- app/models/validation_event.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/validation_event.rb b/app/models/validation_event.rb index 1c0ec155d..dd8edd057 100644 --- a/app/models/validation_event.rb +++ b/app/models/validation_event.rb @@ -6,7 +6,7 @@ # For email_validation event kind also check_level (regex/mx/smtp) is stored in the event_data class ValidationEvent < ApplicationRecord enum event_type: ValidationEvent::EventType::TYPES, _suffix: true - VALIDATION_PERIOD = 4.month.freeze + VALIDATION_PERIOD = 4.month VALID_CHECK_LEVELS = %w[regex mx smtp].freeze VALID_EVENTS_COUNT_THRESHOLD = 5 MX_CHECK = 3 @@ -38,8 +38,10 @@ class ValidationEvent < ApplicationRecord after_create :check_for_force_delete def self.validated_ids_by(klass) - old_records.successful.where('validation_eventable_type = ?', klass) - .pluck(:validation_eventable_id) + old_records + .successful + .where('validation_eventable_type = ?', klass) + .pluck(:validation_eventable_id) end def failed?