diff --git a/app/controllers/registrar/contacts_controller.rb b/app/controllers/registrar/contacts_controller.rb index 756495457..85a1adce5 100644 --- a/app/controllers/registrar/contacts_controller.rb +++ b/app/controllers/registrar/contacts_controller.rb @@ -83,7 +83,7 @@ class Registrar def update authorize! :edit, Depp::Contact - @contact = Depp::Contact.new(contact_params) + @contact = Depp::Contact.find_by_id(contact_params[:id]) if @contact.update_attributes(contact_params) redirect_to registrar_contact_url(@contact.id) diff --git a/app/models/depp/contact.rb b/app/models/depp/contact.rb index 33b7545b7..9050d8ca1 100644 --- a/app/models/depp/contact.rb +++ b/app/models/depp/contact.rb @@ -172,9 +172,9 @@ module Depp end def update_attributes(params) - self.ident_country_code = params[:ident_country_code] - self.ident_type = params[:ident_type] - self.ident = params[:ident] + self.ident_country_code ||= params[:ident_country_code] + self.ident_type ||= params[:ident_type] + self.ident ||= params[:ident] self.name = params[:name] self.email = params[:email]