mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
decrease db load
This commit is contained in:
parent
7477cf8dbe
commit
577c7e0209
4 changed files with 59 additions and 29 deletions
28
lib/tasks/generate_mock_contacts.rake
Normal file
28
lib/tasks/generate_mock_contacts.rake
Normal file
|
@ -0,0 +1,28 @@
|
|||
# namespace :generate_mock do
|
||||
# task contacts: :environment do
|
||||
# 1000.times do
|
||||
# c = Contact.new
|
||||
# c.name = generate_random_string
|
||||
# c.email = generate_random_string + "@" + generate_random_string + ".ee"
|
||||
# c.registrar_id = registrar
|
||||
# c.street = generate_random_string
|
||||
# c.city = generate_random_string
|
||||
# c.zip = '12323'
|
||||
# c.country_code = 'EE'
|
||||
# c.phone = "+372.59813318"
|
||||
# c.ident_country_code = 'EE'
|
||||
# c.ident_type = 'priv'
|
||||
# c.ident = '38903110313'
|
||||
# c.code = generate_random_string + ":" + generate_random_string
|
||||
# c.save
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def generate_random_string
|
||||
# (0...10).map { (65 + rand(26)).chr }.join
|
||||
# end
|
||||
#
|
||||
# def registrar
|
||||
# Registrar.last.id
|
||||
# end
|
||||
# end
|
Loading…
Add table
Add a link
Reference in a new issue