mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Fix deprecated email_notification usage in tests
This commit is contained in:
parent
d48b0f4401
commit
70a6a44525
12 changed files with 15 additions and 164 deletions
|
@ -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 = 1.month.ago.freeze
|
||||
VALIDATION_PERIOD = 1.month.freeze
|
||||
VALID_CHECK_LEVELS = %w[regex mx smtp].freeze
|
||||
VALID_EVENTS_COUNT_THRESHOLD = 5
|
||||
|
||||
|
@ -26,7 +26,7 @@ class ValidationEvent < ApplicationRecord
|
|||
|
||||
belongs_to :validation_eventable, polymorphic: true
|
||||
|
||||
scope :recent, -> { where('created_at > ?', VALIDATION_PERIOD) }
|
||||
scope :recent, -> { where('created_at > ?', Time.zone.now - VALIDATION_PERIOD) }
|
||||
scope :successful, -> { where(success: true) }
|
||||
scope :failed, -> { where(success: false) }
|
||||
scope :regex, -> { where('event_data @> ?', { 'check_level': 'regex' }.to_json) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue