fixed method update

This commit is contained in:
dinsmol 2021-07-20 01:03:18 +03:00
parent fc338dea16
commit d6985dc78b
2 changed files with 4 additions and 4 deletions

View file

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

View file

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