Sha256: 26b6ea661e932a755ff7b141eda5f081d7c17a665bc119970249c62da5ac6b65

Contents?: true

Size: 705 Bytes

Versions: 9

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true
module Shipit
  class DeploySerializer < TaskSerializer
    include GithubUrlHelper

    has_many :commits

    attributes :compare_url, :rollback_url, :additions, :deletions, :rollback_once_aborted_to

    def html_url
      stack_deploy_url(object.stack, object)
    end

    def compare_url
      github_commit_range_url(object.stack, object.since_commit, object.until_commit)
    end

    def rollback_url
      revert_stack_deploy_url(object.stack, object)
    end

    def type
      :deploy
    end

    def rollback_once_aborted_to
      return nil unless object.rollback_once_aborted_to

      DeploySerializer.new(object.rollback_once_aborted_to)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.38.0 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.37.0 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.36.1 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.36.0 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.35.1 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.35.0 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.34.0 app/serializers/shipit/deploy_serializer.rb
shipit-engine-0.33.0 app/serializers/shipit/deploy_serializer.rb