mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Story#113066359 - extract reserved domains regen password from domain to reserved domain
This commit is contained in:
parent
77da9ccd2b
commit
78ffe33dfa
2 changed files with 18 additions and 8 deletions
|
@ -91,10 +91,7 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
after_create :update_reserved_domains
|
||||
def update_reserved_domains
|
||||
return unless in_reserved_list?
|
||||
rd = ReservedDomain.by_domain(name).first
|
||||
rd.password = SecureRandom.hex
|
||||
rd.save
|
||||
ReservedDomain.new_password_for(name) if in_reserved_list?
|
||||
end
|
||||
|
||||
validates :name_dirty, domain_name: true, uniqueness: true
|
||||
|
@ -370,7 +367,7 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def in_reserved_list?
|
||||
ReservedDomain.pw_for(name).present?
|
||||
@in_reserved_list ||= ReservedDomain.by_domain(name).any?
|
||||
end
|
||||
|
||||
def pending_transfer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue