mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Merge pull request #1593 from internetee/upgrade-rails-to-6.0.3
Upgrade Rails from 5.2 to 6.0.3
This commit is contained in:
commit
2ffe9629f9
34 changed files with 272 additions and 112 deletions
3
app/assets/config/manifest.js
Normal file
3
app/assets/config/manifest.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
//= link_tree ../images
|
||||
//= link_directory ../javascripts .js
|
||||
//= link_directory ../stylesheets .css
|
|
@ -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
|
||||
|
|
|
@ -118,7 +118,7 @@ module Epp
|
|||
end
|
||||
|
||||
def render_epp_response(*args)
|
||||
@response = render_to_string(*args, formats: 'xml')
|
||||
@response = render_to_string(*args, formats: [:xml])
|
||||
render xml: @response
|
||||
write_to_epp_log
|
||||
end
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class Action < ApplicationRecord
|
||||
has_paper_trail class_name: 'ActionVersion'
|
||||
has_paper_trail versions: { class_name: 'ActionVersion' }
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :contact
|
||||
|
@ -16,4 +16,4 @@ class Action < ApplicationRecord
|
|||
raise 'Action object is missing' unless contact
|
||||
"contact_#{operation}".to_sym
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -7,9 +7,10 @@ module Versions
|
|||
attr_accessor :version_loader
|
||||
|
||||
if WITH_CHILDREN.include?(model_name.name)
|
||||
has_paper_trail class_name: "#{model_name}Version", meta: { children: :children_log }
|
||||
has_paper_trail versions: { class_name: "#{model_name}Version" },
|
||||
meta: { children: :children_log }
|
||||
else
|
||||
has_paper_trail class_name: "#{model_name}Version"
|
||||
has_paper_trail versions: { class_name: "#{model_name}Version" }
|
||||
end
|
||||
|
||||
# add creator and updator
|
||||
|
@ -18,12 +19,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
|
||||
|
||||
|
@ -51,11 +52,11 @@ module Versions
|
|||
|
||||
# callbacks
|
||||
def touch_domain_version
|
||||
domain.paper_trail.try(:touch_with_version)
|
||||
domain.try(:touch)
|
||||
end
|
||||
|
||||
def touch_domains_version
|
||||
domains.each { |domain| domain.paper_trail.touch_with_version }
|
||||
domains.each(&:touch)
|
||||
end
|
||||
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,7 +1,7 @@
|
|||
# Used in Registrant portal to collect registrant verifications
|
||||
# Registrant postgres user can access this table directly.
|
||||
class RegistrantVerification < ApplicationRecord
|
||||
has_paper_trail class_name: 'RegistrantVerificationVersion'
|
||||
has_paper_trail versions: { class_name: 'RegistrantVerificationVersion' }
|
||||
|
||||
# actions
|
||||
CONFIRMED = 'confirmed'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue