mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Added domain crID
This commit is contained in:
parent
17386c0010
commit
05ed8a45a1
3 changed files with 70 additions and 8 deletions
|
@ -20,6 +20,20 @@ module Versions
|
|||
true
|
||||
end
|
||||
|
||||
# needs refactoring
|
||||
# TODO: optimization work
|
||||
# belongs_to :api_creator, class_name: 'ApiUser', foreign_key: :creator_str
|
||||
# belongs_to :creator, class_name: 'User', foreign_key: :creator_str
|
||||
def creator
|
||||
return nil if creator_str.blank?
|
||||
|
||||
if creator_str =~ /^\d-api-/
|
||||
ApiUser.find(creator_str)
|
||||
else
|
||||
User.find(creator_str)
|
||||
end
|
||||
end
|
||||
|
||||
# callbacks
|
||||
def touch_domain_version
|
||||
domain.try(:touch_with_version)
|
||||
|
|
|
@ -36,7 +36,7 @@ xml.epp_head do
|
|||
|
||||
xml.tag!('domain:clID', @domain.registrar_name)
|
||||
|
||||
xml.tag!('domain:crID', @domain.versions.first.try(:reify).try(:registrar) || @domain.registrar) #TODO Registrar has to be specified
|
||||
xml.tag!('domain:crID', @domain.creator.try(:registrar))
|
||||
|
||||
xml.tag!('domain:crDate', @domain.created_at)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue