Migrate refresh status notes to CheckForceDeleteLift job

This commit is contained in:
Thiago Youssef 2022-09-25 10:31:31 -03:00
parent c6ff1ad300
commit 71d1e9bf47
5 changed files with 75 additions and 56 deletions

View file

@ -35,8 +35,6 @@ class ValidationEvent < ApplicationRecord
scope :smtp, -> { where('event_data @> ?', { 'check_level': 'smtp' }.to_json) }
scope :by_object, ->(object) { where(validation_eventable: object) }
after_create :check_force_delete_lift
def self.validated_ids_by(klass)
old_records
.successful
@ -59,10 +57,4 @@ class ValidationEvent < ApplicationRecord
def object
validation_eventable
end
private
def check_force_delete_lift
CheckForceDeleteLiftJob.perform_later(id, object.id) if object.need_to_lift_force_delete?
end
end