Sha256: 0c9b35809c3cbe9b7ad98ba629b3807e1213d82f488afb5143fd3694e7990132
Contents?: true
Size: 759 Bytes
Versions: 31
Compression:
Stored size: 759 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.blank? 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
31 entries across 31 versions & 1 rubygems