mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 01:17:18 +02:00
Rename DomainTransfer#transfer_to
to new_registrar
This commit is contained in:
parent
d99a63d476
commit
189129ec48
8 changed files with 18 additions and 11 deletions
|
@ -14,7 +14,7 @@ module Concerns::Domain::Transferable
|
|||
domain_transfers.create!(
|
||||
transfer_requested_at: Time.zone.now,
|
||||
old_registrar: old_registrar,
|
||||
transfer_to: new_registrar
|
||||
new_registrar: new_registrar
|
||||
)
|
||||
|
||||
transfer_contacts(new_registrar)
|
||||
|
|
|
@ -2,7 +2,7 @@ class DomainTransfer < ActiveRecord::Base
|
|||
belongs_to :domain
|
||||
|
||||
belongs_to :old_registrar, class_name: 'Registrar'
|
||||
belongs_to :transfer_to, class_name: 'Registrar'
|
||||
belongs_to :new_registrar, class_name: 'Registrar'
|
||||
|
||||
PENDING = 'pending'
|
||||
CLIENT_APPROVED = 'clientApproved'
|
||||
|
|
|
@ -666,8 +666,8 @@ class Epp::Domain < Domain
|
|||
transaction do
|
||||
dt = domain_transfers.create!(
|
||||
transfer_requested_at: Time.zone.now,
|
||||
transfer_to: current_user.registrar,
|
||||
old_registrar: registrar
|
||||
old_registrar: registrar,
|
||||
new_registrar: current_user.registrar
|
||||
)
|
||||
|
||||
if dt.pending?
|
||||
|
@ -709,9 +709,9 @@ class Epp::Domain < Domain
|
|||
transferred_at: Time.zone.now
|
||||
)
|
||||
|
||||
transfer_contacts(pt.transfer_to)
|
||||
transfer_contacts(pt.new_registrar)
|
||||
regenerate_transfer_code
|
||||
self.registrar = pt.transfer_to
|
||||
self.registrar = pt.new_registrar
|
||||
|
||||
attach_legal_document(self.class.parse_legal_document_from_frame(frame))
|
||||
save!(validate: false)
|
||||
|
|
|
@ -140,7 +140,7 @@ class Registrar < ActiveRecord::Base
|
|||
def domain_transfers
|
||||
at = DomainTransfer.arel_table
|
||||
DomainTransfer.where(
|
||||
at[:transfer_to_id].eq(id).or(
|
||||
at[:new_registrar_id].eq(id).or(
|
||||
at[:old_registrar_id].eq(id)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
builder.tag!('domain:trnData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
builder.tag!('domain:name', dt.domain_name)
|
||||
builder.tag!('domain:trStatus', dt.status)
|
||||
builder.tag!('domain:reID', dt.transfer_to.code)
|
||||
builder.tag!('domain:reID', dt.new_registrar.code)
|
||||
builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601))
|
||||
builder.tag!('domain:acID', dt.old_registrar.code)
|
||||
builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601))
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class RenameDomainTransfersTransferToIdToNewRegistrarId < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :domain_transfers, :transfer_to_id, :new_registrar_id
|
||||
end
|
||||
end
|
|
@ -959,7 +959,7 @@ CREATE TABLE domain_transfers (
|
|||
transfer_requested_at timestamp without time zone,
|
||||
transferred_at timestamp without time zone,
|
||||
old_registrar_id integer,
|
||||
transfer_to_id integer,
|
||||
new_registrar_id integer,
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone,
|
||||
wait_until timestamp without time zone
|
||||
|
@ -4457,7 +4457,7 @@ ALTER TABLE ONLY prices
|
|||
--
|
||||
|
||||
ALTER TABLE ONLY domain_transfers
|
||||
ADD CONSTRAINT fk_rails_833ed7f3c0 FOREIGN KEY (transfer_to_id) REFERENCES registrars(id);
|
||||
ADD CONSTRAINT fk_rails_833ed7f3c0 FOREIGN KEY (new_registrar_id) REFERENCES registrars(id);
|
||||
|
||||
|
||||
--
|
||||
|
@ -5064,3 +5064,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180123154407');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20180123165604');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20180123170112');
|
||||
|
||||
|
|
|
@ -1282,7 +1282,7 @@
|
|||
<text text-anchor="start" x="1671" y="-1293.8" font-family="Times,serif" font-size="14.00">transfer_requested_at :datetime</text>
|
||||
<text text-anchor="start" x="1671" y="-1278.8" font-family="Times,serif" font-size="14.00">transferred_at :datetime</text>
|
||||
<text text-anchor="start" x="1671" y="-1263.8" font-family="Times,serif" font-size="14.00">old_registrar_id :integer</text>
|
||||
<text text-anchor="start" x="1671" y="-1248.8" font-family="Times,serif" font-size="14.00">transfer_to_id :integer</text>
|
||||
<text text-anchor="start" x="1671" y="-1248.8" font-family="Times,serif" font-size="14.00">new_registrar_id :integer</text>
|
||||
<text text-anchor="start" x="1671" y="-1233.8" font-family="Times,serif" font-size="14.00">created_at :datetime</text>
|
||||
<text text-anchor="start" x="1671" y="-1218.8" font-family="Times,serif" font-size="14.00">updated_at :datetime</text>
|
||||
<text text-anchor="start" x="1671" y="-1203.8" font-family="Times,serif" font-size="14.00">wait_until :datetime</text>
|
||||
|
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 228 KiB |
Loading…
Add table
Add a link
Reference in a new issue