mirror of
https://github.com/internetee/registry.git
synced 2025-05-29 17:10:08 +02:00
Add reserved boolean to domain #2565
This commit is contained in:
parent
873070cb96
commit
55b746a428
5 changed files with 17 additions and 21 deletions
|
@ -61,6 +61,7 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
before_create :generate_auth_info
|
||||
before_create :set_validity_dates
|
||||
before_create -> { self.reserved = in_reserved_list?; nil }
|
||||
before_update :manage_statuses
|
||||
def manage_statuses
|
||||
return unless registrant_id_changed?
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddReservedFieldToDomain < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :domains, :reserved, :boolean, default: false
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150707154543) do
|
||||
ActiveRecord::Schema.define(version: 20150709092549) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -324,6 +324,7 @@ ActiveRecord::Schema.define(version: 20150707154543) do
|
|||
t.json "pending_json"
|
||||
t.datetime "force_delete_at"
|
||||
t.string "statuses", array: true
|
||||
t.boolean "reserved", default: false
|
||||
end
|
||||
|
||||
add_index "domains", ["delete_at"], name: "index_domains_on_delete_at", using: :btree
|
||||
|
@ -935,7 +936,7 @@ ActiveRecord::Schema.define(version: 20150707154543) do
|
|||
|
||||
create_table "que_jobs", id: false, force: :cascade do |t|
|
||||
t.integer "priority", limit: 2, default: 100, null: false
|
||||
t.datetime "run_at", default: '2015-06-30 14:16:49', null: false
|
||||
t.datetime "run_at", default: '2015-06-30 14:16:50', null: false
|
||||
t.integer "job_id", limit: 8, default: 0, null: false
|
||||
t.text "job_class", null: false
|
||||
t.json "args", default: [], null: false
|
||||
|
|
|
@ -942,7 +942,8 @@ CREATE TABLE domains (
|
|||
registrant_verification_token character varying,
|
||||
pending_json json,
|
||||
force_delete_at timestamp without time zone,
|
||||
statuses character varying[]
|
||||
statuses character varying[],
|
||||
reserved boolean DEFAULT false
|
||||
);
|
||||
|
||||
|
||||
|
@ -2419,7 +2420,7 @@ ALTER SEQUENCE pricelists_id_seq OWNED BY pricelists.id;
|
|||
|
||||
CREATE TABLE que_jobs (
|
||||
priority smallint DEFAULT 100 NOT NULL,
|
||||
run_at timestamp without time zone DEFAULT '2015-06-30 14:16:49.190473'::timestamp without time zone NOT NULL,
|
||||
run_at timestamp without time zone DEFAULT '2015-06-30 14:16:50.905537'::timestamp without time zone NOT NULL,
|
||||
job_id bigint DEFAULT 0 NOT NULL,
|
||||
job_class text NOT NULL,
|
||||
args json DEFAULT '[]'::json NOT NULL,
|
||||
|
@ -4807,26 +4808,14 @@ INSERT INTO schema_migrations (version) VALUES ('20150520164507');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150521120145');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150522164020');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150525075550');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150601083516');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150601083800');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150603141549');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150603211318');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150603212659');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150609093515');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150609103333');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150610111019');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150610112238');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150610144547');
|
||||
|
@ -4835,12 +4824,8 @@ INSERT INTO schema_migrations (version) VALUES ('20150611124920');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150612123111');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150612125720');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150701074344');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150703084206');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150703084632');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150706091724');
|
||||
|
@ -4849,3 +4834,5 @@ INSERT INTO schema_migrations (version) VALUES ('20150707104937');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150707154543');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150709092549');
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ describe 'EPP Domain', epp: true do
|
|||
response[:result_code].should == '1000'
|
||||
d = Domain.last
|
||||
d.legal_documents.count.should == 1
|
||||
d.reserved.should == false
|
||||
end
|
||||
|
||||
# it 'creates ria.ee with valid ds record' do
|
||||
|
@ -244,6 +245,7 @@ describe 'EPP Domain', epp: true do
|
|||
d = Domain.last
|
||||
d.statuses.should match_array(['ok'])
|
||||
d.auth_info.should_not == 'abc' # should generate entirely new auth info after domain create
|
||||
d.reserved.should == true
|
||||
end
|
||||
|
||||
it 'does not create blocked domain' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue