mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Story#117991277 - validate contact with birthday cannot be Estonian
This commit is contained in:
parent
0d87f53e10
commit
c8ccac84f3
1 changed files with 7 additions and 1 deletions
|
@ -81,7 +81,7 @@ class Contact < ActiveRecord::Base
|
||||||
|
|
||||||
ORG = 'org'
|
ORG = 'org'
|
||||||
PRIV = 'priv'
|
PRIV = 'priv'
|
||||||
BIRTHDAY = 'birthday'
|
BIRTHDAY = 'birthday'.freeze
|
||||||
PASSPORT = 'passport'
|
PASSPORT = 'passport'
|
||||||
|
|
||||||
IDENT_TYPES = [
|
IDENT_TYPES = [
|
||||||
|
@ -252,6 +252,8 @@ class Contact < ActiveRecord::Base
|
||||||
if ident.size != 8 || !(ident =~/\A[0-9]{8}\z/)
|
if ident.size != 8 || !(ident =~/\A[0-9]{8}\z/)
|
||||||
errors.add(:ident, err_msg)
|
errors.add(:ident, err_msg)
|
||||||
end
|
end
|
||||||
|
when BIRTHDAY
|
||||||
|
errors.add(:ident, err_msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -284,6 +286,10 @@ class Contact < ActiveRecord::Base
|
||||||
!org?
|
!org?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def birthday?
|
||||||
|
ident_type == BIRTHDAY
|
||||||
|
end
|
||||||
|
|
||||||
def generate_auth_info
|
def generate_auth_info
|
||||||
return if @generate_auth_info_disabled
|
return if @generate_auth_info_disabled
|
||||||
return if auth_info.present?
|
return if auth_info.present?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue