Cross Reference: 010-users_and_teams.rb
xref
: /
ontohub
/
db
/
seeds
/
010-users_and_teams.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
010-users_and_teams.rb revision 6f8248a4d5a940787999b9eb3387d8014c64ef0f
1516
N/A
# Create Admin User.
50
N/A
@
user
=
User.create
!
(
50
N/A
{
50
N/A
email
:
'admin@example.com'
,
50
N/A
name
:
'admin'
,
50
N/A
admin
:
true
,
50
N/A
password
:
'changeme'
50
N/A
}
,
50
N/A
as
: :
admin
50
N/A
)
50
N/A
50
N/A
@
user.confirm
!
50
N/A
50
N/A
# Create Team.
50
N/A
@
team
=
Team.create
! \
50
N/A
name
:
'Lorem Ipsum'
,
50
N/A
admin_user
: @
user
50
N/A
50
N/A
# Create some other users.
50
N/A
%w
(
Bob
Alice
Carol
Dave
Ted
)
.
each_with_index
do
|
name
, i|
50
N/A
@
user
=
User.create
! \
50
N/A
email
:
"#{name}@
example.com
"
,
2026
N/A
name
:
name
,
2608
N/A
password
:
'changeme'
2026
N/A
50
N/A
@
user.confirm
!
202
N/A
2339
N/A
# Add two users to the first team.
50
N/A
@
team.users
<< @
user
if
i <
2
1431
N/A
end
1431
N/A