Merge branch 'master' into registry-623

# Conflicts:
#	app/controllers/admin/registrars_controller.rb
#	app/models/registrar.rb
#	app/views/admin/registrars/_billing.html.erb
#	app/views/admin/registrars/show.html.erb
#	config/locales/admin/registrars.en.yml
#	config/locales/en.yml
#	db/migrate/20180309053424_add_registrars_unique_constraints.rb
#	db/structure.sql
#	test/fixtures/registrars.yml
#	test/integration/admin/registrars/delete_test.rb
#	test/integration/admin/registrars/new_test.rb
#	test/models/registrar_test.rb
This commit is contained in:
Artur Beljajev 2018-03-29 12:09:13 +03:00
commit 837f326ef6
37 changed files with 232 additions and 245 deletions

View file

@ -43,8 +43,13 @@ module Admin
end
def destroy
@registrar.destroy!
redirect_to admin_registrars_url, notice: t('.deleted')
if @registrar.destroy
flash[:notice] = t('.deleted')
redirect_to admin_registrars_url
else
flash[:alert] = @registrar.errors.full_messages.first
redirect_to admin_registrar_url(@registrar)
end
end
private
@ -64,7 +69,6 @@ module Admin
:email,
:phone,
:website,
:billing_email,
:code,
:test_registrar,
:vat_no,