mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
refactoring
This commit is contained in:
parent
dad4790ccc
commit
9c0018d6fe
4 changed files with 6 additions and 8 deletions
|
@ -54,8 +54,8 @@ module Admin
|
||||||
@domain.is_admin = true
|
@domain.is_admin = true
|
||||||
@domain.admin_status_update dp[:statuses]
|
@domain.admin_status_update dp[:statuses]
|
||||||
if @domain.update(dp)
|
if @domain.update(dp)
|
||||||
@domain.admin_store_statuses_history = @domain.statuses
|
# @domain.admin_store_statuses_history = @domain.statuses
|
||||||
@domain.save
|
# @domain.save
|
||||||
flash[:notice] = I18n.t('domain_updated')
|
flash[:notice] = I18n.t('domain_updated')
|
||||||
redirect_to [:admin, @domain]
|
redirect_to [:admin, @domain]
|
||||||
else
|
else
|
||||||
|
|
|
@ -55,6 +55,4 @@ module Domain::RegistryLockable
|
||||||
attached_obj_type: self.class.name
|
attached_obj_type: self.class.name
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -558,8 +558,8 @@ class Domain < ApplicationRecord
|
||||||
# special handling for admin changing status
|
# special handling for admin changing status
|
||||||
def admin_status_update(update)
|
def admin_status_update(update)
|
||||||
# check for deleted status
|
# check for deleted status
|
||||||
self.admin_store_statuses_history = statuses
|
|
||||||
|
|
||||||
|
update(admin_store_statuses_history: update)
|
||||||
statuses.each do |s|
|
statuses.each do |s|
|
||||||
unless update.include? s
|
unless update.include? s
|
||||||
case s
|
case s
|
||||||
|
|
|
@ -17,11 +17,11 @@ class RegistrantUser < User
|
||||||
Country.new(alpha2_code)
|
Country.new(alpha2_code)
|
||||||
end
|
end
|
||||||
|
|
||||||
def companies(company_register = nil)
|
def companies(company_register = CompanyRegister::Client.new)
|
||||||
return [] if ident.include?('-')
|
return [] if ident.include?('-')
|
||||||
|
|
||||||
[OpenStruct.new(registration_number: '43344412', company_name: 'TestFirma'),
|
company_register.representation_rights(citizen_personal_code: ident,
|
||||||
OpenStruct.new(registration_number: '12345678', company_name: 'SuperFirma OU')]
|
citizen_country_code: country.alpha3)
|
||||||
end
|
end
|
||||||
|
|
||||||
def contacts(representable: true)
|
def contacts(representable: true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue