Migrate publishable field name to registrant_publishable

This commit is contained in:
Thiago Youssef 2022-07-20 08:21:22 -03:00 committed by olegphenomenon
parent 4286a6bab7
commit 59fe7dffbe
9 changed files with 15 additions and 13 deletions

View file

@ -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}"

View file

@ -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?

View file

@ -5,6 +5,6 @@ class Registrant < Contact
end
def publishable?
publishable
registrant_publishable
end
end

View file

@ -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