mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Merge branch 'master' into registry-800
# Conflicts: # db/structure.sql
This commit is contained in:
commit
22e1d09dfa
11 changed files with 10 additions and 20 deletions
|
@ -638,6 +638,7 @@ class Domain < ActiveRecord::Base
|
||||||
def as_json(_options)
|
def as_json(_options)
|
||||||
hash = super
|
hash = super
|
||||||
hash['auth_info'] = hash.delete('transfer_code') # API v1 requirement
|
hash['auth_info'] = hash.delete('transfer_code') # API v1 requirement
|
||||||
|
hash['valid_from'] = hash['registered_at'] # API v1 requirement
|
||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ class Epp::Domain < Domain
|
||||||
domain.attributes = domain.attrs_from(frame, current_user)
|
domain.attributes = domain.attrs_from(frame, current_user)
|
||||||
domain.attach_default_contacts
|
domain.attach_default_contacts
|
||||||
domain.registered_at = Time.zone.now
|
domain.registered_at = Time.zone.now
|
||||||
domain.valid_from = Time.zone.now
|
|
||||||
|
|
||||||
period = domain.period.to_i
|
period = domain.period.to_i
|
||||||
plural_period_unit_name = (domain.period_unit == 'm' ? 'months' : 'years').to_sym
|
plural_period_unit_name = (domain.period_unit == 'm' ? 'months' : 'years').to_sym
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
class: 'form-control input-sm' %>
|
class: 'form-control input-sm' %>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt><%= t(:valid_from) %></dt>
|
|
||||||
<dd><%= l(@domain.valid_from) %></dd>
|
|
||||||
|
|
||||||
<dt><%= t(:valid_to) %></dt>
|
<dt><%= t(:valid_to) %></dt>
|
||||||
<dd><%= l(@domain.valid_to) %></dd>
|
<dd><%= l(@domain.valid_to) %></dd>
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,10 @@
|
||||||
%p
|
%p
|
||||||
= link_to t(:pending_epp), '#', class: 'js-pending'
|
= link_to t(:pending_epp), '#', class: 'js-pending'
|
||||||
|
|
||||||
%td{class: changing_css_class(version, "period", "period_unit", "valid_from", "valid_to")}
|
%td{class: changing_css_class(version, "period", "period_unit", "valid_to")}
|
||||||
%p
|
%p
|
||||||
= "#{domain.period}#{domain.period_unit}"
|
= "#{domain.period}#{domain.period_unit}"
|
||||||
%br
|
%br
|
||||||
= "#{l(domain.valid_from, format: :date)}"
|
|
||||||
%br
|
|
||||||
= "#{l(domain.valid_to, format: :date)}"
|
= "#{l(domain.valid_to, format: :date)}"
|
||||||
|
|
||||||
%td
|
%td
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
class: 'form-control input-sm' %>
|
class: 'form-control input-sm' %>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt><%= t(:valid_from) %></dt>
|
|
||||||
<dd><%= l(@domain.valid_from) %></dd>
|
|
||||||
|
|
||||||
<dt><%= t(:valid_to) %></dt>
|
<dt><%= t(:valid_to) %></dt>
|
||||||
<dd><%= l(@domain.valid_to) %></dd>
|
<dd><%= l(@domain.valid_to) %></dd>
|
||||||
|
|
||||||
|
|
5
db/migrate/20180327151906_remove_domains_valid_from.rb
Normal file
5
db/migrate/20180327151906_remove_domains_valid_from.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class RemoveDomainsValidFrom < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
remove_column :domains, :valid_from, :datetime
|
||||||
|
end
|
||||||
|
end
|
|
@ -872,7 +872,6 @@ CREATE TABLE domains (
|
||||||
registrar_id integer NOT NULL,
|
registrar_id integer NOT NULL,
|
||||||
registered_at timestamp without time zone,
|
registered_at timestamp without time zone,
|
||||||
status character varying,
|
status character varying,
|
||||||
valid_from timestamp without time zone,
|
|
||||||
valid_to timestamp without time zone NOT NULL,
|
valid_to timestamp without time zone NOT NULL,
|
||||||
registrant_id integer NOT NULL,
|
registrant_id integer NOT NULL,
|
||||||
transfer_code character varying NOT NULL,
|
transfer_code character varying NOT NULL,
|
||||||
|
@ -4713,5 +4712,7 @@ INSERT INTO schema_migrations (version) VALUES ('20180313124751');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180314122722');
|
INSERT INTO schema_migrations (version) VALUES ('20180314122722');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20180327151906');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20180331200125');
|
INSERT INTO schema_migrations (version) VALUES ('20180331200125');
|
||||||
|
|
||||||
|
|
|
@ -852,7 +852,6 @@
|
||||||
<text text-anchor="start" x="1958.5" y="-2181.3" font-family="Times,serif" font-size="14.00">registrar_id :integer</text>
|
<text text-anchor="start" x="1958.5" y="-2181.3" font-family="Times,serif" font-size="14.00">registrar_id :integer</text>
|
||||||
<text text-anchor="start" x="1958.5" y="-2166.3" font-family="Times,serif" font-size="14.00">registered_at :datetime</text>
|
<text text-anchor="start" x="1958.5" y="-2166.3" font-family="Times,serif" font-size="14.00">registered_at :datetime</text>
|
||||||
<text text-anchor="start" x="1958.5" y="-2151.3" font-family="Times,serif" font-size="14.00">status :string</text>
|
<text text-anchor="start" x="1958.5" y="-2151.3" font-family="Times,serif" font-size="14.00">status :string</text>
|
||||||
<text text-anchor="start" x="1958.5" y="-2136.3" font-family="Times,serif" font-size="14.00">valid_from :datetime</text>
|
|
||||||
<text text-anchor="start" x="1958.5" y="-2121.3" font-family="Times,serif" font-size="14.00">valid_to :datetime</text>
|
<text text-anchor="start" x="1958.5" y="-2121.3" font-family="Times,serif" font-size="14.00">valid_to :datetime</text>
|
||||||
<text text-anchor="start" x="1958.5" y="-2106.3" font-family="Times,serif" font-size="14.00">registrant_id :integer</text>
|
<text text-anchor="start" x="1958.5" y="-2106.3" font-family="Times,serif" font-size="14.00">registrant_id :integer</text>
|
||||||
<text text-anchor="start" x="1958.5" y="-2091.3" font-family="Times,serif" font-size="14.00">transfer_code :string</text>
|
<text text-anchor="start" x="1958.5" y="-2091.3" font-family="Times,serif" font-size="14.00">transfer_code :string</text>
|
||||||
|
|
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 220 KiB |
|
@ -23,7 +23,6 @@ namespace :dev do
|
||||||
period: period,
|
period: period,
|
||||||
period_unit: period_unit,
|
period_unit: period_unit,
|
||||||
registered_at: reg_time,
|
registered_at: reg_time,
|
||||||
valid_from: reg_time,
|
|
||||||
expire_time: reg_time + period.send(duration.second.to_sym),
|
expire_time: reg_time + period.send(duration.second.to_sym),
|
||||||
created_at: reg_time,
|
created_at: reg_time,
|
||||||
updated_at: reg_time,
|
updated_at: reg_time,
|
||||||
|
@ -151,7 +150,6 @@ namespace :dev do
|
||||||
period: period,
|
period: period,
|
||||||
period_unit: 'y',
|
period_unit: 'y',
|
||||||
registered_at: Time.zone.now,
|
registered_at: Time.zone.now,
|
||||||
valid_from: Time.zone.now,
|
|
||||||
expire_time: Time.zone.now + period.years,
|
expire_time: Time.zone.now + period.years,
|
||||||
registrar: registrar,
|
registrar: registrar,
|
||||||
registrant: registrants.sample)
|
registrant: registrants.sample)
|
||||||
|
|
|
@ -336,7 +336,6 @@ namespace :import do
|
||||||
name
|
name
|
||||||
registrar_id
|
registrar_id
|
||||||
registered_at
|
registered_at
|
||||||
valid_from
|
|
||||||
valid_to
|
valid_to
|
||||||
transfer_code
|
transfer_code
|
||||||
created_at
|
created_at
|
||||||
|
|
|
@ -21,11 +21,7 @@ RSpec.describe Epp::Domain, db: false do
|
||||||
expect(domain.registered_at).to eq(Time.zone.parse('05.07.2010'))
|
expect(domain.registered_at).to eq(Time.zone.parse('05.07.2010'))
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has :valid_from set to now' do
|
it 'has :valid_to set to the beginning of next day after :registered_at' do
|
||||||
expect(domain.valid_from).to eq(Time.zone.parse('05.07.2010'))
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'has :valid_to set to the beginning of next day after :valid_from' do
|
|
||||||
expect(domain.valid_to).to eq(Time.zone.parse('06.07.2011 00:00'))
|
expect(domain.valid_to).to eq(Time.zone.parse('06.07.2011 00:00'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue