Updated contact doc and added too long epp message #2753

This commit is contained in:
Priit Tark 2015-07-21 17:02:31 +03:00
parent 1143e16354
commit d4a0f1e783
7 changed files with 19 additions and 16 deletions

View file

@ -23,8 +23,8 @@ class Contact < ActiveRecord::Base
validates :ident_country_code, presence: true, if: proc { |c| %w(bic priv).include? c.ident_type }
validates :code,
uniqueness: { message: :epp_id_taken },
format: { with: /\A[\w\-\:]*\Z/i },
length: { maximum: 100 }
format: { with: /\A[\w\-\:]*\Z/i, message: :invalid },
length: { maximum: 100, message: :too_long_contact_code }
validate :ident_valid_format?
before_validation :set_ident_country_code

View file

@ -125,7 +125,9 @@ class Epp::Contact < Contact
[:ident, :invalid],
[:ident, :invalid_EE_identity_format],
[:ident, :invalid_birthday_format],
[:ident, :invalid_country_code]
[:ident, :invalid_country_code],
[:code, :invalid],
[:code, :too_long_contact_code]
],
'2302' => [ # Object exists
[:code, :epp_id_taken]