summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-10-01 16:09:41 +0900
committerAlessio Caiazza <acaiazza@gitlab.com>2018-10-02 17:08:14 +0200
commitbc5d649a4c456aab4ec7eddc52d13d172a5adace (patch)
treeaddbb8d13cbe2e786a80c311532ea5734a017cb1 /app/serializers
parent7fc74818a32a713d971582f8730b163dade8df3d (diff)
downloadgitlab-ce-bc5d649a4c456aab4ec7eddc52d13d172a5adace.tar.gz
Add unschedule action to status build
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/build_action_entity.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/build_action_entity.rb b/app/serializers/build_action_entity.rb
index 3e81f8f0218..0db7875aa87 100644
--- a/app/serializers/build_action_entity.rb
+++ b/app/serializers/build_action_entity.rb
@@ -12,7 +12,11 @@ class BuildActionEntity < Grape::Entity
end
expose :playable?, as: :playable
- expose :scheduled_at
+ expose :scheduled_at, if: -> (build) { build.scheduled? }
+
+ expose :unschedule_path, if: -> (build) { build.scheduled? } do |build|
+ unschedule_project_job_path(build.project, build)
+ end
private