mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
parent
579da84c58
commit
59e1e18d32
8 changed files with 29 additions and 2 deletions
|
@ -77,7 +77,8 @@ module Admin
|
|||
:website,
|
||||
:billing_email,
|
||||
:code,
|
||||
:test_registrar)
|
||||
:test_registrar,
|
||||
:accounting_customer_code)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,7 +16,9 @@ class Registrar < ActiveRecord::Base
|
|||
|
||||
validates :name, :reg_no, :country_code, :email, :code, presence: true
|
||||
validates :name, :reg_no, :reference_no, :code, uniqueness: true
|
||||
validates :accounting_customer_code, presence: true
|
||||
validate :forbidden_codes
|
||||
|
||||
def forbidden_codes
|
||||
return true unless ['CID'].include? code
|
||||
errors.add(:code, I18n.t(:forbidden_code))
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
.col-md-7
|
||||
= f.email_field :billing_email, class: 'form-control'
|
||||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :accounting_customer_code
|
||||
.col-md-7
|
||||
= f.text_field :accounting_customer_code, class: 'form-control', required: true
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
.panel.panel-default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue