mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Story#111396470 - better code
This commit is contained in:
parent
a20df5243a
commit
e27cd0c316
1 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ class Contact < ActiveRecord::Base
|
||||||
uniqueness: { message: :epp_id_taken },
|
uniqueness: { message: :epp_id_taken },
|
||||||
format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid },
|
format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid },
|
||||||
length: { maximum: 100, message: :too_long_contact_code }
|
length: { maximum: 100, message: :too_long_contact_code }
|
||||||
validate :ident_valid_format?
|
validate :val_ident_valid_format?
|
||||||
validate :uniq_statuses?
|
validate :uniq_statuses?
|
||||||
validate :validate_html
|
validate :validate_html
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ class Contact < ActiveRecord::Base
|
||||||
name || '[no name]'
|
name || '[no name]'
|
||||||
end
|
end
|
||||||
|
|
||||||
def ident_valid_format?
|
def val_ident_valid_format?
|
||||||
case ident_country_code
|
case ident_country_code
|
||||||
when 'EE'.freeze
|
when 'EE'.freeze
|
||||||
err_msg = "invalid_EE_identity_format#{"_update" if id}".to_sym
|
err_msg = "invalid_EE_identity_format#{"_update" if id}".to_sym
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue