Updated disclosure

This commit is contained in:
Andres Keskküla 2014-12-01 11:25:47 +02:00
parent 4e5aecb26d
commit 4800e0c315
11 changed files with 71 additions and 27 deletions

View file

@ -38,7 +38,8 @@ module Epp::ContactsHelper
def info_contact
handle_errors(@contact) and return unless @contact
handle_errors(@contact) and return unless rights?
@disclosure = @contact.disclosure
@disclosure = ContactDisclosure.default_values.merge(@contact.disclosure.as_hash)
@disclosure_policy = @contact.disclosure.attributes_with_flag
@owner = owner?(false)
render 'epp/contacts/info'
end
@ -145,7 +146,7 @@ module Epp::ContactsHelper
case type
when :update
# TODO: support for rem/add
contact_hash = merge_attribute_hash(@ph[:chg], type)
contact_hash = merge_attribute_hash(@ph[:chg], type).delete_if { |_k, v| v.empty? }
else
contact_hash = merge_attribute_hash(@ph, type)
end