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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f8cb5fd6
Commit
f8cb5fd6
authored
May 13, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add own! method on PipleineSchedule
parent
8743f765
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
app/models/ci/pipeline_schedule.rb
app/models/ci/pipeline_schedule.rb
+4
-0
lib/api/pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+1
-1
No files found.
app/models/ci/pipeline_schedule.rb
View file @
f8cb5fd6
...
@@ -24,6 +24,10 @@ module Ci
...
@@ -24,6 +24,10 @@ module Ci
owner
==
current_user
owner
==
current_user
end
end
def
own!
(
user
)
update!
(
owner:
user
)
end
def
inactive?
def
inactive?
!
active?
!
active?
end
end
...
...
lib/api/pipeline_schedules.rb
View file @
f8cb5fd6
...
@@ -100,7 +100,7 @@ module API
...
@@ -100,7 +100,7 @@ module API
pipeline_schedule
=
user_project
.
pipeline_schedules
.
find
(
params
.
delete
(
:pipeline_schedule_id
))
pipeline_schedule
=
user_project
.
pipeline_schedules
.
find
(
params
.
delete
(
:pipeline_schedule_id
))
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
if
pipeline_schedule
.
update
(
owner:
current_user
)
if
pipeline_schedule
.
own!
(
current_user
)
status
:ok
status
:ok
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
else
else
...
...
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