mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Added Api user roles to seeds
This commit is contained in:
parent
e2809cc285
commit
b0d577f6c6
1 changed files with 26 additions and 4 deletions
30
db/seeds.rb
30
db/seeds.rb
|
@ -13,13 +13,24 @@ registrar1 = Registrar.where(
|
|||
code: 'REG1'
|
||||
).first_or_create!
|
||||
|
||||
ApiUser.where(
|
||||
@api_user1 = ApiUser.where(
|
||||
username: 'registrar1',
|
||||
password: 'test1',
|
||||
identity_code: '51001091072',
|
||||
active: true,
|
||||
registrar: registrar1
|
||||
).first_or_create!
|
||||
).first
|
||||
|
||||
if @api_user1.blank?
|
||||
ApiUser.create(
|
||||
username: 'registrar1',
|
||||
password: 'test1',
|
||||
identity_code: '51001091072',
|
||||
active: true,
|
||||
registrar: registrar1,
|
||||
roles: ['super']
|
||||
)
|
||||
end
|
||||
|
||||
registrar2 = Registrar.where(
|
||||
name: 'Registrar Second AS',
|
||||
|
@ -33,13 +44,24 @@ registrar2 = Registrar.where(
|
|||
code: 'REG2'
|
||||
).first_or_create!
|
||||
|
||||
ApiUser.where(
|
||||
@api_user2 = ApiUser.where(
|
||||
username: 'registrar2',
|
||||
password: 'test2',
|
||||
identity_code: '11412090004',
|
||||
active: true,
|
||||
registrar: registrar2
|
||||
).first_or_create!
|
||||
).first
|
||||
|
||||
if @api_user2.blank?
|
||||
ApiUser.create(
|
||||
username: 'registrar2',
|
||||
password: 'test2',
|
||||
identity_code: '11412090004',
|
||||
active: true,
|
||||
registrar: registrar2,
|
||||
roles: ['super']
|
||||
)
|
||||
end
|
||||
|
||||
admin1 = {
|
||||
username: 'user1',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue