mirror of
https://github.com/internetee/registry.git
synced 2025-06-02 18:58:35 +02:00
Use PaperTrail.request.whodunnit
PaperTrail.whodunnit was removed from PaperTrail 10.x
This commit is contained in:
parent
97db4fe4f9
commit
1e1f808c8d
10 changed files with 15 additions and 15 deletions
|
@ -44,7 +44,7 @@ module Api
|
|||
# This controller does not inherit from ApplicationController,
|
||||
# so user_for_paper_trail method is not usable.
|
||||
def set_paper_trail_whodunnit
|
||||
::PaperTrail.whodunnit = current_registrant_user.id_role_username
|
||||
::PaperTrail.request.whodunnit = current_registrant_user.id_role_username
|
||||
end
|
||||
|
||||
def show_not_found_error
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class DomainDeleteConfirmJob < Que::Job
|
||||
def run(domain_id, action, initiator = nil)
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action} by #{initiator}"
|
||||
::PaperTrail.request.whodunnit = "job - #{self.class.name} - #{action} by #{initiator}"
|
||||
# it's recommended to keep transaction against job table as short as possible.
|
||||
ActiveRecord::Base.transaction do
|
||||
domain = Epp::Domain.find(domain_id)
|
||||
|
|
|
@ -3,7 +3,7 @@ class DomainDeleteJob < Que::Job
|
|||
def run(domain_id)
|
||||
domain = Domain.find(domain_id)
|
||||
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name}"
|
||||
::PaperTrail.request.whodunnit = "job - #{self.class.name}"
|
||||
WhoisRecord.where(domain_id: domain.id).destroy_all
|
||||
|
||||
domain.destroy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class DomainUpdateConfirmJob < Que::Job
|
||||
def run(domain_id, action, initiator = nil)
|
||||
::PaperTrail.whodunnit = "job - #{self.class.name} - #{action} by #{initiator}"
|
||||
::PaperTrail.request.whodunnit = "job - #{self.class.name} - #{action} by #{initiator}"
|
||||
# it's recommended to keep transaction against job table as short as possible.
|
||||
ActiveRecord::Base.transaction do
|
||||
domain = Epp::Domain.find(domain_id)
|
||||
|
|
|
@ -7,7 +7,7 @@ module Concerns
|
|||
def start_client_hold
|
||||
log_prepare_client_hold
|
||||
|
||||
::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||
::PaperTrail.request.whodunnit = "cron - #{__method__}"
|
||||
|
||||
::Domain.force_delete_scheduled.each do |domain|
|
||||
proceed_client_hold(domain: domain)
|
||||
|
|
|
@ -18,12 +18,12 @@ module Versions
|
|||
before_update :add_updator
|
||||
|
||||
def add_creator
|
||||
self.creator_str = ::PaperTrail.whodunnit
|
||||
self.creator_str = ::PaperTrail.request.whodunnit
|
||||
true
|
||||
end
|
||||
|
||||
def add_updator
|
||||
self.updator_str = ::PaperTrail.whodunnit
|
||||
self.updator_str = ::PaperTrail.request.whodunnit
|
||||
true
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ class DomainCron
|
|||
def self.clean_expired_pendings
|
||||
STDOUT << "#{Time.zone.now.utc} - Clean expired domain pendings\n" unless Rails.env.test?
|
||||
|
||||
::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||
::PaperTrail.request.whodunnit = "cron - #{__method__}"
|
||||
expire_at = Setting.expire_pending_confirmation.hours.ago
|
||||
count = 0
|
||||
expired_pending_domains = Domain.where('registrant_verification_asked_at <= ?', expire_at)
|
||||
|
@ -38,7 +38,7 @@ class DomainCron
|
|||
end
|
||||
|
||||
def self.start_expire_period
|
||||
::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||
::PaperTrail.request.whodunnit = "cron - #{__method__}"
|
||||
domains = Domain.expired
|
||||
marked = 0
|
||||
real = 0
|
||||
|
@ -64,7 +64,7 @@ class DomainCron
|
|||
def self.start_redemption_grace_period
|
||||
STDOUT << "#{Time.zone.now.utc} - Setting server_hold to domains\n" unless Rails.env.test?
|
||||
|
||||
::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||
::PaperTrail.request.whodunnit = "cron - #{__method__}"
|
||||
|
||||
domains = Domain.outzone_candidates
|
||||
marked = 0
|
||||
|
|
|
@ -58,7 +58,7 @@ class LegalDocument < ApplicationRecord
|
|||
end
|
||||
|
||||
def add_creator
|
||||
self.creator_str = ::PaperTrail.whodunnit
|
||||
self.creator_str = ::PaperTrail.request.whodunnit
|
||||
true
|
||||
end
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Store console and rake changes in versions
|
||||
if defined?(::Rails::Console)
|
||||
PaperTrail.whodunnit = "console-#{`whoami`.strip}"
|
||||
PaperTrail.request.whodunnit = "console-#{`whoami`.strip}"
|
||||
elsif File.basename($PROGRAM_NAME) == 'rake'
|
||||
# rake username does not work when spring enabled
|
||||
PaperTrail.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
|
||||
PaperTrail.request.whodunnit = "rake-#{`whoami`.strip} #{ARGV.join ' '}"
|
||||
end
|
||||
|
||||
class PaperSession
|
||||
|
|
|
@ -16,7 +16,7 @@ class DomainVersionTest < ActiveSupport::TestCase
|
|||
def test_assigns_creator_to_paper_trail_whodunnit
|
||||
duplicate_domain = prepare_duplicate_domain
|
||||
|
||||
PaperTrail.whodunnit = @user.id_role_username
|
||||
PaperTrail.request.whodunnit = @user.id_role_username
|
||||
assert_difference 'duplicate_domain.versions.count', 1 do
|
||||
duplicate_domain.save!
|
||||
end
|
||||
|
@ -28,7 +28,7 @@ class DomainVersionTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_assigns_updator_to_paper_trail_whodunnit
|
||||
PaperTrail.whodunnit = @user.id_role_username
|
||||
PaperTrail.request.whodunnit = @user.id_role_username
|
||||
|
||||
assert_difference '@domain.versions.count', 1 do
|
||||
@domain.apply_registry_lock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue