Sha256: 4f989e8b25a036b22d2d2c5529bd2fe0f1cd9dd42b0f00cacec017f54f1027d0
Contents?: true
Size: 760 Bytes
Versions: 15
Compression:
Stored size: 760 Bytes
Contents
module Shipit class TailTaskSerializer < ActiveModel::Serializer include ChunksHelper include ConditionalAttributes attributes :url, :status, :output, :rollback_url def url return @url if defined? @url @url = next_chunks_url(task) end def include_url? url.present? end def output task.chunks.tail(context[:last_id]).pluck(:text).join end def rollback_url stack_deploy_path(stack, rollback) end def include_rollback_url? !rollback.nil? end private alias_method :task, :object delegate :stack, to: :object def rollback return @rollback if defined? @rollback @rollback = stack.rollbacks.where(parent_id: task.id).last end end end
Version data entries
15 entries across 15 versions & 1 rubygems