mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
115693873-log_changes
This commit is contained in:
parent
248a04f63a
commit
24aec79ceb
5 changed files with 7 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
|||
class DomainDeleteConfirmJob < Que::Job
|
||||
def run(domain_id, action)
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action}"
|
||||
# it's recommended to keep transaction against job table as short as possible.
|
||||
ActiveRecord::Base.transaction do
|
||||
domain = Epp::Domain.find(domain_id)
|
||||
|
@ -13,7 +14,6 @@ class DomainDeleteConfirmJob < Que::Job
|
|||
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
|
||||
domain.cancel_pending_delete
|
||||
end
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action}"
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class DomainUpdateConfirmJob < Que::Job
|
||||
def run(domain_id, action)
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action}"
|
||||
# it's recommended to keep transaction against job table as short as possible.
|
||||
ActiveRecord::Base.transaction do
|
||||
domain = Epp::Domain.find(domain_id)
|
||||
|
@ -14,7 +15,6 @@ class DomainUpdateConfirmJob < Que::Job
|
|||
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
||||
domain.clean_pendings_lowlevel
|
||||
end
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action}"
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
class UpdateWhoisRecordJob < Que::Job
|
||||
|
||||
def run(names, type)
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{type}"
|
||||
|
||||
klass = case type
|
||||
when 'reserved'then ReservedDomain
|
||||
when 'blocked' then BlockedDomain
|
||||
|
@ -8,7 +10,6 @@ class UpdateWhoisRecordJob < Que::Job
|
|||
end
|
||||
|
||||
Array(names).each do |name|
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{type}"
|
||||
record = klass.find_by(name: name)
|
||||
if record
|
||||
send "update_#{type}", record
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue