mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 07:52:04 +02:00
Merge branch '111396946-blocked_and_reserved_view' into staging
This commit is contained in:
commit
3178c13fd4
14 changed files with 208 additions and 54 deletions
|
@ -3,6 +3,9 @@ class ReservedDomain < ActiveRecord::Base
|
|||
before_save :fill_empty_passwords
|
||||
before_save :generate_data
|
||||
before_destroy :remove_data
|
||||
validates :name, domain_name: true, uniqueness: true
|
||||
|
||||
|
||||
|
||||
|
||||
class << self
|
||||
|
@ -22,7 +25,12 @@ class ReservedDomain < ActiveRecord::Base
|
|||
|
||||
|
||||
def fill_empty_passwords
|
||||
self.password = SecureRandom.hex unless self.password
|
||||
|
||||
if self.password.empty?
|
||||
|
||||
self.password = SecureRandom.hex
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def name= val
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue