Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8aafe8b4
Commit
8aafe8b4
authored
Dec 08, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update association calls after prefix change
parent
5bd6722c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
ee/app/services/incident_management/oncall_rotations/create_service.rb
...es/incident_management/oncall_rotations/create_service.rb
+3
-3
ee/spec/policies/incident_management/oncall_rotation_policy_spec.rb
...licies/incident_management/oncall_rotation_policy_spec.rb
+1
-1
ee/spec/services/incident_management/oncall_rotations/create_service_spec.rb
...cident_management/oncall_rotations/create_service_spec.rb
+1
-1
No files found.
ee/app/services/incident_management/oncall_rotations/create_service.rb
View file @
8aafe8b4
...
...
@@ -26,14 +26,14 @@ module IncidentManagement
return
error_no_license
unless
available?
return
error_no_permissions
unless
allowed?
oncall_rotation
=
schedule
.
oncall_
rotations
.
create
(
params
.
except
(
:participants
))
oncall_rotation
=
schedule
.
rotations
.
create
(
params
.
except
(
:participants
))
return
error_in_create
(
oncall_rotation
)
unless
oncall_rotation
.
persisted?
new_participants
=
Array
(
params
[
:participants
]).
map
do
|
participant
|
OncallParticipant
.
new
(
oncall_
rotation:
oncall_rotation
,
participant
:
participant
[
:user
],
rotation:
oncall_rotation
,
user
:
participant
[
:user
],
color_palette:
participant
[
:color_palette
],
color_weight:
participant
[
:color_weight
]
)
...
...
ee/spec/policies/incident_management/oncall_rotation_policy_spec.rb
View file @
8aafe8b4
...
...
@@ -6,7 +6,7 @@ RSpec.describe IncidentManagement::OncallRotationPolicy do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:oncall_schedule
)
{
create
(
:incident_management_oncall_schedule
,
project:
project
)
}
let_it_be_with_refind
(
:oncall_rotation
)
{
create
(
:incident_management_oncall_rotation
,
oncall_
schedule:
oncall_schedule
)
}
let_it_be_with_refind
(
:oncall_rotation
)
{
create
(
:incident_management_oncall_rotation
,
schedule:
oncall_schedule
)
}
subject
(
:policy
)
{
described_class
.
new
(
user
,
oncall_rotation
)
}
...
...
ee/spec/services/incident_management/oncall_rotations/create_service_spec.rb
View file @
8aafe8b4
...
...
@@ -69,7 +69,7 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do
end
context
'when an on-call rotation already exists'
do
let!
(
:oncall_
schedule
)
{
create
(
:incident_management_oncall_rotation
,
oncall_
schedule:
schedule
,
name:
'On-call rotation'
)
}
let!
(
:oncall_
rotation
)
{
create
(
:incident_management_oncall_rotation
,
schedule:
schedule
,
name:
'On-call rotation'
)
}
it_behaves_like
'error response'
,
'Name has already been taken'
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment