emails = [
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
]
emails.each { |email|
u = User.new(email: email, name: email.split('@').first.capitalize, time_zone: 'UTC')
u.save!
u
}
o = Organization.find _
p = Project.find _
admin_user = User.find_by!(email: '[email protected]')
a = Invites::CreateAction.new(organization: o, emails: emails, invited_by_user: admin_user, role: UserOrganization::User, invited_projects: {'3' => [p.id] })
is = a.call
is.each { |invite|
u = User.find_by!(email: invite.email)
invite.accept(u)
}
Last active
February 27, 2024 18:32
-
-
Save Chocksy/4a7c23387b47de3ec87632125b1cea5b to your computer and use it in GitHub Desktop.
Create users for organization
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment