mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Migrate publishable
field name to registrant_publishable
This commit is contained in:
parent
4286a6bab7
commit
59fe7dffbe
9 changed files with 15 additions and 13 deletions
|
@ -72,7 +72,7 @@ module Api
|
|||
contact.disclosed_attributes = disclosed_attributes
|
||||
end
|
||||
|
||||
contact.publishable = reparsed_request_json[:publishable] if reparsed_request_json[:publishable].present?
|
||||
contact.registrant_publishable = reparsed_request_json[:registrant_publishable]
|
||||
|
||||
logger.debug "Setting.address_processing is set to #{Setting.address_processing}"
|
||||
|
||||
|
|
|
@ -64,7 +64,8 @@ class Contact < ApplicationRecord
|
|||
|
||||
validate :validate_html
|
||||
validate :validate_country_code, if: -> { self.class.address_processing? }
|
||||
validates :publishable, inclusion: { in: [true, false] }
|
||||
validates :registrant_publishable, inclusion: { in: [true, false] }, if: -> { registrant? }
|
||||
validates :registrant_publishable, inclusion: { in: [false] }, unless: -> { registrant? }
|
||||
|
||||
after_initialize do
|
||||
self.status_notes = {} if status_notes.nil?
|
||||
|
|
|
@ -5,6 +5,6 @@ class Registrant < Contact
|
|||
end
|
||||
|
||||
def publishable?
|
||||
publishable
|
||||
registrant_publishable
|
||||
end
|
||||
end
|
||||
|
|
|
@ -52,7 +52,7 @@ class WhoisRecord < ApplicationRecord
|
|||
|
||||
h[:email] = registrant.email
|
||||
h[:phone] = registrant.phone
|
||||
h[:publishable] = registrant.publishable?
|
||||
h[:registrant_publishable] = registrant.publishable?
|
||||
h[:registrant_changed] = registrant.updated_at.try(:to_s, :iso8601)
|
||||
h[:registrant_disclosed_attributes] = registrant.disclosed_attributes
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue