2018-07-19 14:43:13 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-06 12:45:46 -04:00
|
|
|
class JobGroupEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :name
|
|
|
|
expose :size
|
2018-09-11 13:13:24 -04:00
|
|
|
expose :detailed_status, as: :status, with: DetailedStatusEntity
|
2017-06-07 05:36:41 -04:00
|
|
|
expose :jobs, with: JobEntity
|
2017-05-06 12:45:46 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
alias_method :group, :object
|
|
|
|
|
|
|
|
def detailed_status
|
2017-05-09 00:15:34 -04:00
|
|
|
group.detailed_status(request.current_user)
|
2017-05-06 12:45:46 -04:00
|
|
|
end
|
|
|
|
end
|