mirror of
https://github.com/czhu12/canine.git
synced 2025-12-16 16:35:10 -06:00
12 lines
284 B
Ruby
12 lines
284 B
Ruby
class SSO::CreateTeamsInAccount
|
|
extend LightService::Action
|
|
expects :account, :team_names
|
|
promises :teams
|
|
|
|
executed do |context|
|
|
context.teams = context.team_names.map do |team_hash|
|
|
context.account.teams.find_or_create_by!(name: team_hash[:name])
|
|
end
|
|
end
|
|
end
|