mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Added bang to seeds methods, otherwise they fail silently
This commit is contained in:
parent
c14452e756
commit
95abb1161d
1 changed files with 48 additions and 15 deletions
63
db/seeds.rb
63
db/seeds.rb
|
@ -6,29 +6,62 @@
|
||||||
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
||||||
# Mayor.create(name: 'Emanuel', city: cities.first)
|
# Mayor.create(name: 'Emanuel', city: cities.first)
|
||||||
|
|
||||||
Country.where(name: 'Estonia', iso: 'EE').first_or_create
|
Country.where(name: 'Estonia', iso: 'EE').first_or_create!
|
||||||
Country.where(name: 'Latvia', iso: 'LV').first_or_create
|
Country.where(name: 'Latvia', iso: 'LV').first_or_create!
|
||||||
|
|
||||||
zone = Registrar.where(
|
zone = Registrar.where(
|
||||||
name: 'Zone Media OÜ',
|
name: 'Zone Media OÜ',
|
||||||
reg_no: '10577829',
|
reg_no: '10577829',
|
||||||
address: 'Lõõtsa 2, Tallinna linn, Harju maakond, 11415'
|
address: 'Lõõtsa 2, Tallinna linn, Harju maakond, 11415',
|
||||||
#country: Country.first
|
country: Country.first
|
||||||
).first_or_create
|
).first_or_create!
|
||||||
|
|
||||||
EppUser.where(username: 'zone', password: 'ghyt9e4fu', active: true, registrar: zone).first_or_create
|
EppUser.where(
|
||||||
|
username: 'zone',
|
||||||
|
password: 'ghyt9e4fu',
|
||||||
|
active: true,
|
||||||
|
registrar: zone
|
||||||
|
).first_or_create!
|
||||||
|
|
||||||
elkdata = Registrar.where(
|
elkdata = Registrar.where(
|
||||||
name: 'Elkdata OÜ',
|
name: 'Elkdata OÜ',
|
||||||
reg_no: '10510593',
|
reg_no: '10510593',
|
||||||
address: 'Tondi 51-10, 11316 Tallinn'
|
address: 'Tondi 51-10, 11316 Tallinn',
|
||||||
#country: Country.first
|
country: Country.first
|
||||||
).first_or_create
|
).first_or_create!
|
||||||
|
|
||||||
EppUser.where(username: 'elkdata', password: '8932iods', active: true, registrar: elkdata).first_or_create
|
EppUser.where(
|
||||||
|
username: 'elkdata',
|
||||||
|
password: '8932iods',
|
||||||
|
active: true,
|
||||||
|
registrar: elkdata
|
||||||
|
).first_or_create!
|
||||||
|
|
||||||
User.where(username: 'gitlab', password: '12345', email: 'enquiries@gitlab.eu', admin: true, identity_code: '37810013855', country: Country.where(name: 'Estonia').first).first_or_create
|
User.where(
|
||||||
User.where(username: 'zone', password: '54321', email: 'info-info@zone.ee', admin: false, identity_code: '37810010085',
|
username: 'gitlab',
|
||||||
registrar_id: zone.id, country: Country.where(name: 'Estonia').first).first_or_create
|
password: '12345',
|
||||||
User.where(username: 'elkdata', password: '32154', email: 'info-info@elkdata.ee', admin: false, identity_code: '37810010727',
|
email: 'enquiries@gitlab.eu',
|
||||||
registrar_id: elkdata.id, country: Country.where(name: 'Estonia').first).first_or_create
|
admin: true,
|
||||||
|
identity_code: '37810013855',
|
||||||
|
country: Country.where(name: 'Estonia').first
|
||||||
|
).first_or_create!
|
||||||
|
|
||||||
|
User.where(
|
||||||
|
username: 'zone',
|
||||||
|
password: '54321',
|
||||||
|
email: 'info-info@zone.ee',
|
||||||
|
admin: false,
|
||||||
|
identity_code: '37810010085',
|
||||||
|
registrar_id: zone.id,
|
||||||
|
country: Country.where(name: 'Estonia').first
|
||||||
|
).first_or_create!
|
||||||
|
|
||||||
|
User.where(
|
||||||
|
username: 'elkdata',
|
||||||
|
password: '32154',
|
||||||
|
email: 'info-info@elkdata.ee',
|
||||||
|
admin: false,
|
||||||
|
identity_code: '37810010727',
|
||||||
|
registrar_id: elkdata.id,
|
||||||
|
country: Country.where(name: 'Estonia').first
|
||||||
|
).first_or_create!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue