mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 12:09:34 +02:00
Fix codeclimate errors
This commit is contained in:
parent
c13a3e39fd
commit
ab3ababc1a
1 changed files with 5 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
||||||
# For email_validation event kind also check_level (regex/mx/smtp) is stored in the event_data
|
# For email_validation event kind also check_level (regex/mx/smtp) is stored in the event_data
|
||||||
class ValidationEvent < ApplicationRecord
|
class ValidationEvent < ApplicationRecord
|
||||||
enum event_type: ValidationEvent::EventType::TYPES, _suffix: true
|
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_CHECK_LEVELS = %w[regex mx smtp].freeze
|
||||||
VALID_EVENTS_COUNT_THRESHOLD = 5
|
VALID_EVENTS_COUNT_THRESHOLD = 5
|
||||||
MX_CHECK = 3
|
MX_CHECK = 3
|
||||||
|
@ -38,8 +38,10 @@ class ValidationEvent < ApplicationRecord
|
||||||
after_create :check_for_force_delete
|
after_create :check_for_force_delete
|
||||||
|
|
||||||
def self.validated_ids_by(klass)
|
def self.validated_ids_by(klass)
|
||||||
old_records.successful.where('validation_eventable_type = ?', klass)
|
old_records
|
||||||
.pluck(:validation_eventable_id)
|
.successful
|
||||||
|
.where('validation_eventable_type = ?', klass)
|
||||||
|
.pluck(:validation_eventable_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def failed?
|
def failed?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue