debian-mirror-gitlab/app/serializers/build_action_entity.rb

24 lines
407 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
class BuildActionEntity < Grape::Entity
include RequestAwareEntity
expose :name do |build|
build.name
end
expose :path do |build|
2017-09-10 17:25:29 +05:30
play_project_job_path(build.project, build)
2017-08-17 22:00:37 +05:30
end
expose :playable?, as: :playable
private
alias_method :build, :object
def playable?
build.playable? && can?(request.current_user, :update_build, build)
end
end