From c1949e70695486052fd5642ae409aa45f624e4ad Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Thu, 29 Jan 2015 18:01:10 +0200 Subject: [PATCH] fail seed if cannot create --- db/seeds.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 0faf698dc..e409e9bd7 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -14,28 +14,28 @@ registrar1 = Registrar.where( reg_no: '10300220', address: 'Pärnu mnt 2, Tallinna linn, Harju maakond, 11415', country: Country.first -).first_or_create +).first_or_create! ApiUser.where( username: 'registrar1', password: 'test1', active: true, registrar: registrar1 -).first_or_create +).first_or_create! registrar2 = Registrar.where( name: 'Registrar Second AS', reg_no: '10529229', address: 'Vabaduse pst 32, 11316 Tallinn', country: Country.first -).first_or_create +).first_or_create! ApiUser.where( username: 'registrar2', password: 'test2', active: true, registrar: registrar2 -).first_or_create +).first_or_create! User.where( username: 'user1', @@ -43,7 +43,7 @@ User.where( email: 'user1@example.ee', identity_code: '37810013855', country: Country.where(name: 'Estonia').first -).first_or_create +).first_or_create! User.where( username: 'user2', @@ -51,7 +51,7 @@ User.where( email: 'user2@example.ee', identity_code: '37810010085', country: Country.where(name: 'Estonia').first -).first_or_create +).first_or_create! User.where( username: 'user3', @@ -59,7 +59,7 @@ User.where( email: 'user3@example.ee', identity_code: '37810010727', country: Country.where(name: 'Estonia').first -).first_or_create +).first_or_create! User.update_all(roles: ['admin']) # Setting.whois_enabled = true only uncomment this if you wish whois