Extract domain transfers controller

#660
This commit is contained in:
Artur Beljajev 2018-01-22 16:29:37 +02:00
parent d64686777c
commit b11b6f7d8b
10 changed files with 33 additions and 20 deletions

View file

@ -0,0 +1,15 @@
class Registrar
class DomainTransfersController < DeppController
before_action do
authorize! :transfer, Depp::Domain
end
def new
end
def create
domain = Depp::Domain.new(current_user: depp_current_user)
@data = domain.transfer(params)
end
end
end

View file

@ -146,16 +146,6 @@ class Registrar
end
end
def transfer
authorize! :transfer, Depp::Domain
if request.post? && params[:domain_name]
@data = @domain.transfer(params)
render 'transfer_index' and return unless response_ok?
else
render 'transfer_index'
end
end
def search_contacts
authorize! :create, Depp::Domain