Merge pull request #1517 from internetee/1516-no-method-error-on-domain-registration

Registrar: Permit & turn ActiveController::Parameters to hash on domain create
This commit is contained in:
Timo Võhmar 2020-02-06 16:51:31 +02:00 committed by GitHub
commit 56f1e38b3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,7 @@ class Registrar
def create
authorize! :create, Depp::Domain
@domain_params = params[:domain]
@domain_params = domain_params.to_h
@data = @domain.create(@domain_params)
if response_ok?
@ -187,5 +187,12 @@ class Registrar
:valid_to_lteq,
:s)
end
def domain_params
params.require(:domain).permit(:name, :period, :registrant, :registrant_helper, :reserved_pw,
:legal_document, contacts_attributes: {},
nameservers_attributes: {},
dnskeys_attributes: {})
end
end
end