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,

View file

@ -3,7 +3,7 @@ class Registrar
protect_from_forgery except: :back
skip_authorization_check # actually anyone can pay, no problems at all
skip_before_action :authenticate_user!, :check_ip, only: [:back]
skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back]
before_action :check_bank
# to handle existing model we should