mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 22:46:22 +02:00
Add publishable
contact field
This commit is contained in:
parent
9623b3e207
commit
5c129b24ef
6 changed files with 17 additions and 4 deletions
|
@ -72,6 +72,8 @@ module Api
|
|||
contact.disclosed_attributes = disclosed_attributes
|
||||
end
|
||||
|
||||
contact.publishable = reparsed_request_json[:publishable] if reparsed_request_json[:publishable]
|
||||
|
||||
logger.debug "Setting.address_processing is set to #{Setting.address_processing}"
|
||||
|
||||
if Setting.address_processing && params[:address]
|
||||
|
|
|
@ -64,6 +64,7 @@ class Contact < ApplicationRecord
|
|||
|
||||
validate :validate_html
|
||||
validate :validate_country_code, if: -> { self.class.address_processing? }
|
||||
validates_inclusion_of :publishable, in: [false], unless: -> { registrant? }
|
||||
|
||||
after_initialize do
|
||||
self.status_notes = {} if status_notes.nil?
|
||||
|
|
|
@ -3,4 +3,8 @@ class Registrant < Contact
|
|||
def epp_code_map
|
||||
{}
|
||||
end
|
||||
|
||||
def publishable?
|
||||
publishable
|
||||
end
|
||||
end
|
||||
|
|
|
@ -52,6 +52,7 @@ class WhoisRecord < ApplicationRecord
|
|||
|
||||
h[:email] = registrant.email
|
||||
h[:phone] = registrant.phone
|
||||
h[:publishable] = registrant.publishable?
|
||||
h[:registrant_changed] = registrant.updated_at.try(:to_s, :iso8601)
|
||||
h[:registrant_disclosed_attributes] = registrant.disclosed_attributes
|
||||
|
||||
|
|
5
db/migrate/20220715145808_add_publishable_to_contacts.rb
Normal file
5
db/migrate/20220715145808_add_publishable_to_contacts.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddPublishableToContacts < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :contacts, :publishable, :boolean, default: false
|
||||
end
|
||||
end
|
|
@ -670,7 +670,8 @@ CREATE TABLE public.contacts (
|
|||
up_date timestamp without time zone,
|
||||
uuid uuid DEFAULT public.gen_random_uuid() NOT NULL,
|
||||
disclosed_attributes character varying[] DEFAULT '{}'::character varying[] NOT NULL,
|
||||
email_history character varying
|
||||
email_history character varying,
|
||||
publishable boolean DEFAULT false
|
||||
);
|
||||
|
||||
|
||||
|
@ -5417,6 +5418,5 @@ INSERT INTO "schema_migrations" (version) VALUES
|
|||
('20220524130709'),
|
||||
('20220701113409'),
|
||||
('20220818075833'),
|
||||
('20221011061840');
|
||||
|
||||
|
||||
('20221011061840'),
|
||||
('20220715145808');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue