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

22 lines
376 B
Ruby
Raw Normal View History

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