mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
added tasks for migrate data and tests
This commit is contained in:
parent
fb352fb718
commit
d260eacc1a
6 changed files with 81 additions and 0 deletions
9
app/jobs/migrate_before_force_delete_statuses_job.rb
Normal file
9
app/jobs/migrate_before_force_delete_statuses_job.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class MigrateBeforeForceDeleteStatusesJob < ApplicationJob
|
||||
def perform
|
||||
domains = Domain.where.not(statuses_before_force_delete: nil)
|
||||
domains.each do |domain|
|
||||
domain.force_delete_domain_statuses_history = domain.statuses_before_force_delete
|
||||
domain.save
|
||||
end
|
||||
end
|
||||
end
|
9
app/jobs/migrate_statuses_to_domain_history_job.rb
Normal file
9
app/jobs/migrate_statuses_to_domain_history_job.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
class MigrateStatusesToDomainHistoryJob < ApplicationJob
|
||||
def perform
|
||||
domains = Domain.all.select { |d| !d.locked_by_registrant? }
|
||||
domains.each do |domain|
|
||||
domain.admin_store_statuses_history = domain.statuses
|
||||
domain.save
|
||||
end
|
||||
end
|
||||
end
|
|
@ -22,6 +22,10 @@ class Domain < ApplicationRecord
|
|||
alias_attribute :auth_info, :transfer_code # Old attribute name; for PaperTrail
|
||||
alias_attribute :registered_at, :created_at
|
||||
|
||||
store_accessor :json_statuses_history,
|
||||
:force_delete_domain_statuses_history,
|
||||
:admin_store_statuses_history
|
||||
|
||||
# TODO: whois requests ip whitelist for full info for own domains and partial info for other domains
|
||||
# TODO: most inputs should be trimmed before validatation, probably some global logic?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue