mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Make street, city, zip and country optional if address processing is disabled
#251
This commit is contained in:
parent
5e1c43f7cc
commit
cefd310cc0
2 changed files with 37 additions and 2 deletions
|
@ -18,8 +18,8 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
accepts_nested_attributes_for :legal_documents
|
||||
|
||||
validates :name, :phone, :email, :ident, :ident_type,
|
||||
:street, :city, :zip, :country_code, :registrar, presence: true
|
||||
validates :name, :phone, :email, :ident, :ident_type, :registrar, presence: true
|
||||
validates :street, :city, :zip, :country_code, presence: true, if: 'self.class.address_processing?'
|
||||
|
||||
# Phone nr validation is very minimam in order to support legacy requirements
|
||||
validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue