mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Rename DomainTransfer#transfer_from
to old_registrar
This commit is contained in:
parent
404932316d
commit
d99a63d476
8 changed files with 18 additions and 11 deletions
|
@ -13,7 +13,7 @@ module Concerns::Domain::Transferable
|
||||||
|
|
||||||
domain_transfers.create!(
|
domain_transfers.create!(
|
||||||
transfer_requested_at: Time.zone.now,
|
transfer_requested_at: Time.zone.now,
|
||||||
transfer_from: old_registrar,
|
old_registrar: old_registrar,
|
||||||
transfer_to: new_registrar
|
transfer_to: new_registrar
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class DomainTransfer < ActiveRecord::Base
|
class DomainTransfer < ActiveRecord::Base
|
||||||
belongs_to :domain
|
belongs_to :domain
|
||||||
|
|
||||||
belongs_to :transfer_from, class_name: 'Registrar'
|
belongs_to :old_registrar, class_name: 'Registrar'
|
||||||
belongs_to :transfer_to, class_name: 'Registrar'
|
belongs_to :transfer_to, class_name: 'Registrar'
|
||||||
|
|
||||||
PENDING = 'pending'
|
PENDING = 'pending'
|
||||||
|
@ -37,7 +37,7 @@ class DomainTransfer < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify_losing_registrar(contacts, registrant)
|
def notify_losing_registrar(contacts, registrant)
|
||||||
transfer_from.messages.create!(
|
old_registrar.messages.create!(
|
||||||
body: I18n.t('domain_transfer_was_approved', contacts: contacts, registrant: registrant),
|
body: I18n.t('domain_transfer_was_approved', contacts: contacts, registrant: registrant),
|
||||||
attached_obj_id: id,
|
attached_obj_id: id,
|
||||||
attached_obj_type: self.class.to_s
|
attached_obj_type: self.class.to_s
|
||||||
|
|
|
@ -667,7 +667,7 @@ class Epp::Domain < Domain
|
||||||
dt = domain_transfers.create!(
|
dt = domain_transfers.create!(
|
||||||
transfer_requested_at: Time.zone.now,
|
transfer_requested_at: Time.zone.now,
|
||||||
transfer_to: current_user.registrar,
|
transfer_to: current_user.registrar,
|
||||||
transfer_from: registrar
|
old_registrar: registrar
|
||||||
)
|
)
|
||||||
|
|
||||||
if dt.pending?
|
if dt.pending?
|
||||||
|
@ -696,7 +696,7 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
def approve_transfer(frame, current_user)
|
def approve_transfer(frame, current_user)
|
||||||
pt = pending_transfer
|
pt = pending_transfer
|
||||||
if current_user.registrar != pt.transfer_from
|
if current_user.registrar != pt.old_registrar
|
||||||
throw :epp_error, {
|
throw :epp_error, {
|
||||||
msg: I18n.t('transfer_can_be_approved_only_by_current_registrar'),
|
msg: I18n.t('transfer_can_be_approved_only_by_current_registrar'),
|
||||||
code: '2304'
|
code: '2304'
|
||||||
|
@ -722,7 +722,7 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
def reject_transfer(frame, current_user)
|
def reject_transfer(frame, current_user)
|
||||||
pt = pending_transfer
|
pt = pending_transfer
|
||||||
if current_user.registrar != pt.transfer_from
|
if current_user.registrar != pt.old_registrar
|
||||||
throw :epp_error, {
|
throw :epp_error, {
|
||||||
msg: I18n.t('transfer_can_be_rejected_only_by_current_registrar'),
|
msg: I18n.t('transfer_can_be_rejected_only_by_current_registrar'),
|
||||||
code: '2304'
|
code: '2304'
|
||||||
|
|
|
@ -141,7 +141,7 @@ class Registrar < ActiveRecord::Base
|
||||||
at = DomainTransfer.arel_table
|
at = DomainTransfer.arel_table
|
||||||
DomainTransfer.where(
|
DomainTransfer.where(
|
||||||
at[:transfer_to_id].eq(id).or(
|
at[:transfer_to_id].eq(id).or(
|
||||||
at[:transfer_from_id].eq(id)
|
at[:old_registrar_id].eq(id)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ builder.tag!('domain:trnData', 'xmlns:domain' => 'https://epp.tld.ee/schema/doma
|
||||||
builder.tag!('domain:trStatus', dt.status)
|
builder.tag!('domain:trStatus', dt.status)
|
||||||
builder.tag!('domain:reID', dt.transfer_to.code)
|
builder.tag!('domain:reID', dt.transfer_to.code)
|
||||||
builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601))
|
builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601))
|
||||||
builder.tag!('domain:acID', dt.transfer_from.code)
|
builder.tag!('domain:acID', dt.old_registrar.code)
|
||||||
builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601))
|
builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601))
|
||||||
builder.tag!('domain:exDate', dt.domain_valid_to.try(:iso8601))
|
builder.tag!('domain:exDate', dt.domain_valid_to.try(:iso8601))
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class RenameDomainTransfersTransferFromIdToOldRegistrarId < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
rename_column :domain_transfers, :transfer_from_id, :old_registrar_id
|
||||||
|
end
|
||||||
|
end
|
|
@ -958,7 +958,7 @@ CREATE TABLE domain_transfers (
|
||||||
status character varying,
|
status character varying,
|
||||||
transfer_requested_at timestamp without time zone,
|
transfer_requested_at timestamp without time zone,
|
||||||
transferred_at timestamp without time zone,
|
transferred_at timestamp without time zone,
|
||||||
transfer_from_id integer,
|
old_registrar_id integer,
|
||||||
transfer_to_id integer,
|
transfer_to_id integer,
|
||||||
created_at timestamp without time zone,
|
created_at timestamp without time zone,
|
||||||
updated_at timestamp without time zone,
|
updated_at timestamp without time zone,
|
||||||
|
@ -4441,7 +4441,7 @@ ALTER TABLE ONLY domains
|
||||||
--
|
--
|
||||||
|
|
||||||
ALTER TABLE ONLY domain_transfers
|
ALTER TABLE ONLY domain_transfers
|
||||||
ADD CONSTRAINT fk_rails_59c422f73d FOREIGN KEY (transfer_from_id) REFERENCES registrars(id);
|
ADD CONSTRAINT fk_rails_59c422f73d FOREIGN KEY (old_registrar_id) REFERENCES registrars(id);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -5062,3 +5062,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180123124342');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180123154407');
|
INSERT INTO schema_migrations (version) VALUES ('20180123154407');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20180123165604');
|
||||||
|
|
||||||
|
|
|
@ -1281,7 +1281,7 @@
|
||||||
<text text-anchor="start" x="1671" y="-1308.8" font-family="Times,serif" font-size="14.00">status :string</text>
|
<text text-anchor="start" x="1671" y="-1308.8" font-family="Times,serif" font-size="14.00">status :string</text>
|
||||||
<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="-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="-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">transfer_from_id :integer</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">transfer_to_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="-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="-1218.8" font-family="Times,serif" font-size="14.00">updated_at :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