Sha256: 53019e05fac170b326fa9baa8500dc11832cb30292a08c8cc13fe2830c9c1834

Contents?: true

Size: 582 Bytes

Versions: 8

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true
module Shipit
  class MergeRequestSerializer < ActiveModel::Serializer
    include GithubUrlHelper
    include ConditionalAttributes

    has_one :merge_requested_by
    has_one :head, serializer: ShortCommitSerializer

    attributes :id, :number, :title, :github_id, :additions, :deletions, :state, :merge_status, :mergeable,
      :merge_requested_at, :rejection_reason, :html_url, :branch, :base_ref

    def html_url
      github_pull_request_url(object)
    end

    def include_rejection_reason?
      object.rejection_reason?
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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