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
Jérome Perrin
gitlab-ce
Commits
bfa028e1
Commit
bfa028e1
authored
May 19, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deleted_at from Entity. Use find_by. Remove returns.
parent
f6a8894a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+5
-5
spec/fixtures/api/schemas/pipeline_schedule.json
spec/fixtures/api/schemas/pipeline_schedule.json
+1
-2
No files found.
lib/api/entities.rb
View file @
bfa028e1
...
...
@@ -689,7 +689,7 @@ module API
class
PipelineSchedule
<
Grape
::
Entity
expose
:id
expose
:description
,
:ref
,
:cron
,
:cron_timezone
,
:next_run_at
,
:active
expose
:created_at
,
:updated_at
,
:deleted_at
expose
:created_at
,
:updated_at
expose
:last_pipeline
,
using:
Entities
::
PipelineBasic
,
if:
{
type: :full
}
expose
:owner
,
using:
Entities
::
UserBasic
end
...
...
lib/api/pipeline_schedules.rb
View file @
bfa028e1
...
...
@@ -29,7 +29,7 @@ module API
get
':id/pipeline_schedules/:pipeline_schedule_id'
do
authorize!
:read_pipeline_schedule
,
user_project
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
end
...
...
@@ -72,7 +72,7 @@ module API
put
':id/pipeline_schedules/:pipeline_schedule_id'
do
authorize!
:create_pipeline_schedule
,
user_project
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
if
pipeline_schedule
.
update
(
declared_params
(
include_missing:
false
))
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
...
...
@@ -90,7 +90,7 @@ module API
post
':id/pipeline_schedules/:pipeline_schedule_id/take_ownership'
do
authorize!
:create_pipeline_schedule
,
user_project
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
if
pipeline_schedule
.
own!
(
current_user
)
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
,
type: :full
...
...
@@ -108,7 +108,7 @@ module API
delete
':id/pipeline_schedules/:pipeline_schedule_id'
do
authorize!
:admin_pipeline_schedule
,
user_project
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
present
pipeline_schedule
.
destroy
,
with:
Entities
::
PipelineSchedule
,
type: :full
end
...
...
@@ -124,7 +124,7 @@ module API
@pipeline_schedule
||=
user_project
.
pipeline_schedules
.
preload
([
:owner
,
:last_pipeline
])
.
find
(
params
.
delete
(
:pipeline_schedule_id
))
.
find
_by
(
id:
params
.
delete
(
:pipeline_schedule_id
))
end
end
end
...
...
spec/fixtures/api/schemas/pipeline_schedule.json
View file @
bfa028e1
...
...
@@ -10,7 +10,6 @@
"active"
:
{
"type"
:
"boolean"
},
"created_at"
:
{
"type"
:
"date"
},
"updated_at"
:
{
"type"
:
"date"
},
"deleted_at"
:
{
"type"
:
"date"
},
"last_pipeline"
:
{
"type"
:
[
"object"
,
"null"
],
"properties"
:
{
...
...
@@ -36,7 +35,7 @@
},
"required"
:
[
"id"
,
"description"
,
"ref"
,
"cron"
,
"cron_timezone"
,
"next_run_at"
,
"active"
,
"created_at"
,
"updated_at"
,
"
deleted_at"
,
"
owner"
"active"
,
"created_at"
,
"updated_at"
,
"owner"
],
"additionalProperties"
:
false
}
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