mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
fixed method update
This commit is contained in:
parent
fc338dea16
commit
d6985dc78b
2 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue